builder->getExt('pdo_pgsql') !== null) { throw new WrongUsageException('swoole-hook-pgsql provides pdo_pgsql, if you enable pgsql hook for swoole, you must remove pdo_pgsql extension.'); } } public function getUnixConfigureArg(bool $shared = false): string { // enable swoole pgsql hook return '--enable-swoole-pgsql'; } public function runCliCheckUnix(): void { // skip if not enable swoole if ($this->builder->getExt('swoole') === null) { return; } $sharedExtensions = $this->getSharedExtensionLoadString(); [$ret, $out] = shell()->execWithResult(BUILD_BIN_PATH . '/php -n' . $sharedExtensions . ' --ri "' . $this->getDistName() . '"'); $out = implode('', $out); if ($ret !== 0) { throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: php-cli returned ' . $ret); } if (!str_contains($out, 'coroutine_pgsql')) { throw new RuntimeException('swoole pgsql hook is not enabled correctly.'); } } }