update checks for shared swoole-hook extensions

This commit is contained in:
DubbleClick 2025-08-25 12:08:53 +07:00
parent 75f734daa8
commit 8104ff7236
6 changed files with 42 additions and 6 deletions

View File

@ -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": {

View File

@ -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,' : ' ';

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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!");
}
}