mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
use type=addon and arg-type=none
This commit is contained in:
parent
1c7fa0132d
commit
324ba0d3dc
@ -843,7 +843,8 @@
|
|||||||
"zlib"
|
"zlib"
|
||||||
],
|
],
|
||||||
"lib-suggests": [
|
"lib-suggests": [
|
||||||
"zstd"
|
"zstd",
|
||||||
|
"unixodbc"
|
||||||
],
|
],
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"openssl",
|
"openssl",
|
||||||
@ -863,7 +864,7 @@
|
|||||||
},
|
},
|
||||||
"notes": true,
|
"notes": true,
|
||||||
"type": "addon",
|
"type": "addon",
|
||||||
"arg-type": "custom",
|
"arg-type": "none",
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"mysqlnd",
|
"mysqlnd",
|
||||||
"pdo",
|
"pdo",
|
||||||
@ -882,7 +883,7 @@
|
|||||||
},
|
},
|
||||||
"notes": true,
|
"notes": true,
|
||||||
"type": "addon",
|
"type": "addon",
|
||||||
"arg-type": "custom",
|
"arg-type": "none",
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"pgsql",
|
"pgsql",
|
||||||
"pdo",
|
"pdo",
|
||||||
@ -896,7 +897,7 @@
|
|||||||
},
|
},
|
||||||
"notes": true,
|
"notes": true,
|
||||||
"type": "addon",
|
"type": "addon",
|
||||||
"arg-type": "custom",
|
"arg-type": "none",
|
||||||
"ext-depends": [
|
"ext-depends": [
|
||||||
"sqlite3",
|
"sqlite3",
|
||||||
"pdo",
|
"pdo",
|
||||||
|
|||||||
@ -269,6 +269,9 @@ class Extension
|
|||||||
$ret = '';
|
$ret = '';
|
||||||
foreach ($order as $ext) {
|
foreach ($order as $ext) {
|
||||||
if ($ext instanceof self && $ext->isBuildShared()) {
|
if ($ext instanceof self && $ext->isBuildShared()) {
|
||||||
|
if (Config::getExt($ext->getName(), 'type', false) === 'addon') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (Config::getExt($ext->getName(), 'zend-extension', false) === true) {
|
if (Config::getExt($ext->getName(), 'zend-extension', false) === true) {
|
||||||
$ret .= " -d \"zend_extension={$ext->getName()}\"";
|
$ret .= " -d \"zend_extension={$ext->getName()}\"";
|
||||||
} else {
|
} else {
|
||||||
@ -352,6 +355,9 @@ class Extension
|
|||||||
*/
|
*/
|
||||||
public function buildShared(): void
|
public function buildShared(): void
|
||||||
{
|
{
|
||||||
|
if (Config::getExt($this->getName(), 'type') === 'addon') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (Config::getExt($this->getName(), 'type') === 'builtin' || Config::getExt($this->getName(), 'build-with-php') === true) {
|
if (Config::getExt($this->getName(), 'type') === 'builtin' || Config::getExt($this->getName(), 'build-with-php') === true) {
|
||||||
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
|
if (file_exists(BUILD_MODULES_PATH . '/' . $this->getName() . '.so')) {
|
||||||
|
|||||||
@ -16,20 +16,13 @@ class swoole_hook_mysql extends Extension
|
|||||||
return 'swoole';
|
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
|
public function runCliCheckUnix(): void
|
||||||
{
|
{
|
||||||
// skip if not enable swoole
|
// skip if not enable swoole
|
||||||
if ($this->builder->getExt('swoole') === null) {
|
if ($this->builder->getExt('swoole') === null) {
|
||||||
return;
|
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);
|
$out = implode('', $out);
|
||||||
if ($ret !== 0) {
|
if ($ret !== 0) {
|
||||||
throw new ValidationException("extension {$this->getName()} failed compile check: php-cli returned {$ret}", validation_module: 'extension swoole_hook_mysql sanity check');
|
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');
|
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
|
public function runCliCheckUnix(): void
|
||||||
{
|
{
|
||||||
// skip if not enable swoole
|
// 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
|
public function runCliCheckUnix(): void
|
||||||
{
|
{
|
||||||
// skip if not enable swoole
|
// 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');
|
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