mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
use type=addon and arg-type=none
This commit is contained in:
parent
1c7fa0132d
commit
324ba0d3dc
@ -843,7 +843,8 @@
|
||||
"zlib"
|
||||
],
|
||||
"lib-suggests": [
|
||||
"zstd"
|
||||
"zstd",
|
||||
"unixodbc"
|
||||
],
|
||||
"ext-depends": [
|
||||
"openssl",
|
||||
@ -863,7 +864,7 @@
|
||||
},
|
||||
"notes": true,
|
||||
"type": "addon",
|
||||
"arg-type": "custom",
|
||||
"arg-type": "none",
|
||||
"ext-depends": [
|
||||
"mysqlnd",
|
||||
"pdo",
|
||||
@ -882,7 +883,7 @@
|
||||
},
|
||||
"notes": true,
|
||||
"type": "addon",
|
||||
"arg-type": "custom",
|
||||
"arg-type": "none",
|
||||
"ext-depends": [
|
||||
"pgsql",
|
||||
"pdo",
|
||||
@ -896,7 +897,7 @@
|
||||
},
|
||||
"notes": true,
|
||||
"type": "addon",
|
||||
"arg-type": "custom",
|
||||
"arg-type": "none",
|
||||
"ext-depends": [
|
||||
"sqlite3",
|
||||
"pdo",
|
||||
|
||||
@ -269,6 +269,9 @@ class Extension
|
||||
$ret = '';
|
||||
foreach ($order as $ext) {
|
||||
if ($ext instanceof self && $ext->isBuildShared()) {
|
||||
if (Config::getExt($ext->getName(), 'type', false) === 'addon') {
|
||||
continue;
|
||||
}
|
||||
if (Config::getExt($ext->getName(), 'zend-extension', false) === true) {
|
||||
$ret .= " -d \"zend_extension={$ext->getName()}\"";
|
||||
} else {
|
||||
@ -352,6 +355,9 @@ class Extension
|
||||
*/
|
||||
public function buildShared(): void
|
||||
{
|
||||
if (Config::getExt($this->getName(), 'type') === 'addon') {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (Config::getExt($this->getName(), 'type') === 'builtin' || Config::getExt($this->getName(), 'build-with-php') === true) {
|
||||
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
|
||||
|
||||
@ -16,20 +16,13 @@ class swoole_hook_mysql extends Extension
|
||||
return 'swoole';
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
// pdo_mysql doesn't need to be disabled
|
||||
// enable swoole-hook-mysql will enable mysqli, pdo, pdo_mysql, we don't need to add any additional options
|
||||
return '';
|
||||
}
|
||||
|
||||
public function runCliCheckUnix(): void
|
||||
{
|
||||
// skip if not enable swoole
|
||||
if ($this->builder->getExt('swoole') === null) {
|
||||
return;
|
||||
}
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $this->getSharedExtensionLoadString() . ' --ri "swoole"', false);
|
||||
[$ret, $out] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n' . $this->getSharedExtensionLoadString() . ' --ri "swoole"');
|
||||
$out = implode('', $out);
|
||||
if ($ret !== 0) {
|
||||
throw new ValidationException("extension {$this->getName()} failed compile check: php-cli returned {$ret}", validation_module: 'extension swoole_hook_mysql sanity check');
|
||||
@ -38,15 +31,4 @@ class swoole_hook_mysql extends Extension
|
||||
throw new ValidationException('swoole mysql hook is not enabled correctly.', validation_module: 'Extension swoole mysql hook availability check');
|
||||
}
|
||||
}
|
||||
|
||||
public function getSharedExtensionLoadString(): string
|
||||
{
|
||||
$ret = parent::getSharedExtensionLoadString();
|
||||
return str_replace(' -d "extension=' . $this->name . '"', '', $ret);
|
||||
}
|
||||
|
||||
public function buildShared(): void
|
||||
{
|
||||
// nothing to do, it's built into swoole
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,11 +25,6 @@ class swoole_hook_pgsql extends Extension
|
||||
}
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return ''; // enabled in swoole.php
|
||||
}
|
||||
|
||||
public function runCliCheckUnix(): void
|
||||
{
|
||||
// skip if not enable swoole
|
||||
@ -52,15 +47,4 @@ class swoole_hook_pgsql extends Extension
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function getSharedExtensionLoadString(): string
|
||||
{
|
||||
$ret = parent::getSharedExtensionLoadString();
|
||||
return str_replace(' -d "extension=' . $this->name . '"', '', $ret);
|
||||
}
|
||||
|
||||
public function buildShared(): void
|
||||
{
|
||||
// nothing to do, it's built into swoole
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,11 +25,6 @@ class swoole_hook_sqlite extends Extension
|
||||
}
|
||||
}
|
||||
|
||||
public function getUnixConfigureArg(bool $shared = false): string
|
||||
{
|
||||
return ''; // enabled in swoole.php
|
||||
}
|
||||
|
||||
public function runCliCheckUnix(): void
|
||||
{
|
||||
// skip if not enable swoole
|
||||
@ -46,15 +41,4 @@ class swoole_hook_sqlite extends Extension
|
||||
throw new ValidationException('swoole sqlite hook is not enabled correctly.', validation_module: 'Extension swoole sqlite hook availability check');
|
||||
}
|
||||
}
|
||||
|
||||
public function getSharedExtensionLoadString(): string
|
||||
{
|
||||
$ret = parent::getSharedExtensionLoadString();
|
||||
return str_replace(' -d "extension=' . $this->name . '"', '', $ret);
|
||||
}
|
||||
|
||||
public function buildShared(): void
|
||||
{
|
||||
// nothing to do, it's built into swoole
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user