mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Add PHP_BUILD_PROVIDER to env.ini
This commit is contained in:
parent
9487051796
commit
34edb6e329
@ -10,6 +10,7 @@
|
|||||||
;
|
;
|
||||||
; Here's a list of env vars, these value cannot be changed anywhere:
|
; Here's a list of env vars, these value cannot be changed anywhere:
|
||||||
;
|
;
|
||||||
|
; SPC_VERSION: the version of static-php-cli.
|
||||||
; WORKING_DIR: the working directory of the build process. (default: `$(pwd)`)
|
; WORKING_DIR: the working directory of the build process. (default: `$(pwd)`)
|
||||||
; ROOT_DIR: the root directory of static-php-cli. (default: `/path/to/static-php-cli`, when running in phar or micro mode: `phar://path/to/spc.phar`)
|
; ROOT_DIR: the root directory of static-php-cli. (default: `/path/to/static-php-cli`, when running in phar or micro mode: `phar://path/to/spc.phar`)
|
||||||
; BUILD_ROOT_PATH: the root path of the build process. (default: `$(pwd)/buildroot`)
|
; BUILD_ROOT_PATH: the root path of the build process. (default: `$(pwd)/buildroot`)
|
||||||
@ -43,6 +44,8 @@ SPC_SKIP_PHP_VERSION_CHECK="no"
|
|||||||
SPC_SKIP_DOCTOR_CHECK_ITEMS=""
|
SPC_SKIP_DOCTOR_CHECK_ITEMS=""
|
||||||
; extra modules that xcaddy will include in the FrankenPHP build
|
; extra modules that xcaddy will include in the FrankenPHP build
|
||||||
SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES="--with github.com/dunglas/frankenphp/caddy --with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain/caddy --with github.com/dunglas/caddy-cbrotli"
|
SPC_CMD_VAR_FRANKENPHP_XCADDY_MODULES="--with github.com/dunglas/frankenphp/caddy --with github.com/dunglas/mercure/caddy --with github.com/dunglas/vulcain/caddy --with github.com/dunglas/caddy-cbrotli"
|
||||||
|
; The display message for php version output (PHP >= 8.4 available)
|
||||||
|
PHP_BUILD_PROVIDER="static-php-cli ${SPC_VERSION}"
|
||||||
|
|
||||||
; EXTENSION_DIR where the built php will look for extension when a .ini instructs to load them
|
; EXTENSION_DIR where the built php will look for extension when a .ini instructs to load them
|
||||||
; only useful for builds targeting not pure-static linking
|
; only useful for builds targeting not pure-static linking
|
||||||
|
|||||||
@ -595,11 +595,6 @@ class SourcePatcher
|
|||||||
$file = str_replace('PHP_INI_BEGIN()', "PHP_INI_BEGIN()\n\tPHP_INI_ENTRY(\"static-php-cli.version\",\t\"{$version}\",\tPHP_INI_ALL,\tNULL)", $file);
|
$file = str_replace('PHP_INI_BEGIN()', "PHP_INI_BEGIN()\n\tPHP_INI_ENTRY(\"static-php-cli.version\",\t\"{$version}\",\tPHP_INI_ALL,\tNULL)", $file);
|
||||||
FileSystem::writeFile(SOURCE_PATH . '/php-src/main/main.c', $file);
|
FileSystem::writeFile(SOURCE_PATH . '/php-src/main/main.c', $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add PHP_BUILD_PROVIDER
|
|
||||||
if (getenv('PHP_BUILD_PROVIDER') === false) {
|
|
||||||
putenv("PHP_BUILD_PROVIDER=static-php-cli {$version}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -6,9 +6,12 @@ use SPC\builder\freebsd\SystemUtil as BSDSystemUtil;
|
|||||||
use SPC\builder\linux\SystemUtil as LinuxSystemUtil;
|
use SPC\builder\linux\SystemUtil as LinuxSystemUtil;
|
||||||
use SPC\builder\macos\SystemUtil as MacOSSystemUtil;
|
use SPC\builder\macos\SystemUtil as MacOSSystemUtil;
|
||||||
use SPC\builder\windows\SystemUtil as WindowsSystemUtil;
|
use SPC\builder\windows\SystemUtil as WindowsSystemUtil;
|
||||||
|
use SPC\ConsoleApplication;
|
||||||
use SPC\store\FileSystem;
|
use SPC\store\FileSystem;
|
||||||
use SPC\util\GlobalEnvManager;
|
use SPC\util\GlobalEnvManager;
|
||||||
|
|
||||||
|
// static-php-cli version string
|
||||||
|
const SPC_VERSION = ConsoleApplication::VERSION;
|
||||||
// output path for everything, other paths are defined relative to this by default
|
// output path for everything, other paths are defined relative to this by default
|
||||||
define('BUILD_ROOT_PATH', FileSystem::convertPath(is_string($a = getenv('BUILD_ROOT_PATH')) ? $a : (WORKING_DIR . '/buildroot')));
|
define('BUILD_ROOT_PATH', FileSystem::convertPath(is_string($a = getenv('BUILD_ROOT_PATH')) ? $a : (WORKING_DIR . '/buildroot')));
|
||||||
// output path for header files for development
|
// output path for header files for development
|
||||||
@ -44,6 +47,7 @@ define('SEPARATED_PATH', [
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// add these to env vars with same name
|
// add these to env vars with same name
|
||||||
|
GlobalEnvManager::putenv('SPC_VERSION=' . SPC_VERSION);
|
||||||
GlobalEnvManager::putenv('BUILD_ROOT_PATH=' . BUILD_ROOT_PATH);
|
GlobalEnvManager::putenv('BUILD_ROOT_PATH=' . BUILD_ROOT_PATH);
|
||||||
GlobalEnvManager::putenv('BUILD_INCLUDE_PATH=' . BUILD_INCLUDE_PATH);
|
GlobalEnvManager::putenv('BUILD_INCLUDE_PATH=' . BUILD_INCLUDE_PATH);
|
||||||
GlobalEnvManager::putenv('BUILD_LIB_PATH=' . BUILD_LIB_PATH);
|
GlobalEnvManager::putenv('BUILD_LIB_PATH=' . BUILD_LIB_PATH);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user