mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
update checks for shared swoole-hook extensions
This commit is contained in:
parent
75f734daa8
commit
8104ff7236
@ -863,7 +863,8 @@
|
||||
"ext-depends": [
|
||||
"mysqlnd",
|
||||
"pdo",
|
||||
"pdo_mysql"
|
||||
"pdo_mysql",
|
||||
"swoole"
|
||||
],
|
||||
"ext-suggests": [
|
||||
"mysqli"
|
||||
@ -880,7 +881,8 @@
|
||||
"arg-type": "custom",
|
||||
"ext-depends": [
|
||||
"pgsql",
|
||||
"pdo"
|
||||
"pdo",
|
||||
"swoole"
|
||||
]
|
||||
},
|
||||
"swoole-hook-sqlite": {
|
||||
@ -893,7 +895,8 @@
|
||||
"arg-type": "custom",
|
||||
"ext-depends": [
|
||||
"sqlite3",
|
||||
"pdo"
|
||||
"pdo",
|
||||
"swoole"
|
||||
]
|
||||
},
|
||||
"swow": {
|
||||
|
||||
@ -61,11 +61,11 @@ class swoole extends Extension
|
||||
|
||||
// additional feature: swoole-pgsql, it should depend on lib [postgresql], but it will lack of CFLAGS etc.
|
||||
// so this is a tricky way (enable ext [pgsql,pdo] to add postgresql hook and pdo_pgsql support)
|
||||
$arg .= $this->builder->getExt('swoole-hook-pgsql') ? '' : ' --disable-swoole-pgsql';
|
||||
$arg .= $this->builder->getExt('swoole-hook-pgsql') ? ' --enable-swoole-pgsql' : ' --disable-swoole-pgsql';
|
||||
|
||||
// enable this feature , need remove pdo_sqlite
|
||||
// more info : https://wenda.swoole.com/detail/109023
|
||||
$arg .= $this->builder->getExt('swoole-hook-sqlite') ? '' : ' --disable-swoole-sqlite';
|
||||
$arg .= $this->builder->getExt('swoole-hook-sqlite') ? ' --enable-swoole-sqlite' : ' --disable-swoole-sqlite';
|
||||
|
||||
// enable this feature , need stop pdo_*
|
||||
// $arg .= $this->builder->getLib('unixodbc') ? ' --with-swoole-odbc=unixODBC,' : ' ';
|
||||
|
||||
@ -38,4 +38,15 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,4 +53,15 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,4 +47,15 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ class BuildPHPCommand extends BuildCommand
|
||||
$path = FileSystem::convertPath("{$build_root_path}/modules/{$ext}.so");
|
||||
if (file_exists(BUILD_MODULES_PATH . "/{$ext}.so")) {
|
||||
logger()->info("Shared extension [{$ext}] path{$fixed}: {$path}");
|
||||
} else {
|
||||
} elseif (!str_contains($ext, 'swoole-hook')) {
|
||||
logger()->warning("Shared extension [{$ext}] not found, please check!");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user