From a1d0b514dde753d2d06282e56492d58636958931 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 22:33:35 +0800 Subject: [PATCH 1/3] add getWorkExtDir() for extension hook --- sapi/src/Preprocessor.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sapi/src/Preprocessor.php b/sapi/src/Preprocessor.php index 69b0119d4d..bce3f105a7 100644 --- a/sapi/src/Preprocessor.php +++ b/sapi/src/Preprocessor.php @@ -270,6 +270,10 @@ public function getWorkDir(): string return $this->workDir; } + public function getWorkExtDir(): string + { + return $this->workDir . '/ext/'; + } public function setExtraLdflags(string $flags) { $this->extraLdflags = $flags; @@ -330,8 +334,7 @@ public function donotInstallLibrary() /** * @param string $url * @param string $file - * @param string $md5sum - * @throws Exception + * @param object|null $project [ $lib or $ext ] */ protected function downloadFile(string $url, string $file, object $project = null) { @@ -832,7 +835,7 @@ public function execute(): void $this->setExtensionDependency(); if ($this->getInputOption('skip-download')) { - $this->generateLibraryDownloadLinks(); + $this->generateDownloadLinks(); } $this->generateFile(__DIR__ . '/template/make.php', $this->rootDir . '/make.sh'); @@ -868,7 +871,7 @@ public function execute(): void } } - protected function generateLibraryDownloadLinks(): void + protected function generateDownloadLinks(): void { $this->mkdirIfNotExists($this->getRootDir() . '/var/download-box/', 0755, true); From 342ddb34c0da137ef2a90524765c2160de63e5d0 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 22:54:31 +0800 Subject: [PATCH 2/3] update prepare.php --- prepare.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/prepare.php b/prepare.php index c3501151a3..1ee22402de 100755 --- a/prepare.php +++ b/prepare.php @@ -12,13 +12,19 @@ $p = Preprocessor::getInstance(); $p->parseArguments($argc, $argv); +$buildType = $p->getBuildType(); +if ($p->getInputOption('with-build-type')) { + $buildType = $p->getInputOption('with-build-type'); + $p->setBuildType($buildType); +} + # clean old make.sh -if (($p->getInputOption('with-build-type') == 'dev') && file_exists(__DIR__ . '/make.sh')) { +if (($buildType == 'dev') && file_exists(__DIR__ . '/make.sh')) { unlink(__DIR__ . '/make.sh'); } // Sync code from php-src -$p->setPhpSrcDir($homeDir . '/.phpbrew/build/php-' . BUILD_PHP_VERSION); +$p->setPhpSrcDir($p->getWorkDir() . '/var/php-' . BUILD_PHP_VERSION); // Compile directly on the host machine, not in the docker container if ($p->getInputOption('without-docker') || ($p->isMacos())) { @@ -26,11 +32,6 @@ $p->setBuildDir(__DIR__ . '/thirdparty'); } -$buildType = $p->getBuildType(); -if ($p->getInputOption('with-build-type')) { - $buildType = $p->getInputOption('with-build-type'); - $p->setBuildType($buildType); -} if ($p->getInputOption('with-global-prefix')) { $p->setGlobalPrefix($p->getInputOption('with-global-prefix')); From 3ba47bf1bfed52f9f67cacc8d118786bf2350936 Mon Sep 17 00:00:00 2001 From: jingjingxyk Date: Thu, 11 Jul 2024 23:05:41 +0800 Subject: [PATCH 3/3] update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e26677db6a..c3d018f4cd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# build static php-cli runtime +# build static php-cli runtime and php-fpm -构建静态 原生 php-cli 运行时 +构建静态 原生 php-cli 运行时 和 fastcgi 进程管理器 php-fpm ## 说明