Package original PHP alongside the Swift server

This commit is contained in:
SantaSpeen committed 2026-11-22 04:01:25 +03:00
1 parent 5852266ed9
commit 66a35a9f7c
5 files changed
+66 -5

No files matched your search

+12 -1
View File
@@ -4,7 +4,13 @@ umask 077
server_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
project_dir="$(dirname "$server_dir")"
runtime="${EZSERVER_RUNTIME:-$project_dir/.build/ezserver-macos/runtime}"
if [[ -d "$server_dir/runtime" ]]; then
default_runtime="$server_dir/runtime"
else
default_runtime="$project_dir/.build/ezserver-macos/runtime"
fi
runtime="${EZSERVER_RUNTIME:-$default_runtime}"
export PATH="$PATH:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/local/sbin"
nginx="${EZSERVER_NGINX:-nginx}"
php="${EZSERVER_PHP:-php}"
fpm="${EZSERVER_PHP_FPM:-php-fpm}"
@@ -70,8 +76,13 @@ if (strlen(trim(file_get_contents($argv[1]))) < 32) {
}
' "$EZSERVER_JWT_KEY_FILE"
"$php" "$server_dir/init-sqlite.php" "$EZSERVER_SQLITE"
fi
if [[ -d "$server_dir/runtime" || -n "${EZSERVER_SQLITE:-}" ]]; then
cp -R "$EZSERVER_RUNTIME" "$stage/runtime"
chmod -R u+rwX "$stage/runtime"
export EZSERVER_RUNTIME="$stage/runtime"
fi
if [[ -n "${EZSERVER_SQLITE:-}" ]]; then
config="$EZSERVER_RUNTIME/www/ezwebserver/src/application/config/production"
mkdir -p "$config"
cp "$server_dir/sqlite-database.php" "$config/database.php"