mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
fix pdo_sqlsrv
This commit is contained in:
@@ -322,16 +322,6 @@ class Extension
|
|||||||
->execWithEnv('make -j' . $this->builder->concurrency)
|
->execWithEnv('make -j' . $this->builder->concurrency)
|
||||||
->execWithEnv('make install');
|
->execWithEnv('make install');
|
||||||
|
|
||||||
// copy shared library
|
|
||||||
$extensionDirFile = (getenv('EXTENSION_DIR') ?: $this->source_dir . '/modules') . '/' . $this->getName() . '.so';
|
|
||||||
$sourceDirFile = $this->source_dir . '/modules/' . $this->getName() . '.so';
|
|
||||||
if (file_exists($extensionDirFile)) {
|
|
||||||
copy($extensionDirFile, BUILD_MODULES_PATH . '/' . $this->getName() . '.so');
|
|
||||||
} elseif (file_exists($sourceDirFile)) {
|
|
||||||
copy($sourceDirFile, BUILD_MODULES_PATH . '/' . $this->getName() . '.so');
|
|
||||||
} else {
|
|
||||||
throw new RuntimeException('extension ' . $this->getName() . ' built successfully, but into an unexpected location.');
|
|
||||||
}
|
|
||||||
// check shared extension with php-cli
|
// check shared extension with php-cli
|
||||||
if (file_exists(BUILD_BIN_PATH . '/php')) {
|
if (file_exists(BUILD_BIN_PATH . '/php')) {
|
||||||
$this->runSharedExtensionCheckUnix();
|
$this->runSharedExtensionCheckUnix();
|
||||||
|
|||||||
40
src/SPC/builder/extension/pdo_sqlsrv.php
Normal file
40
src/SPC/builder/extension/pdo_sqlsrv.php
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\exception\FileSystemException;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
use SPC\util\SPCConfigUtil;
|
||||||
|
|
||||||
|
#[CustomExt('pdo_sqlsrv')]
|
||||||
|
class pdo_sqlsrv extends Extension
|
||||||
|
{
|
||||||
|
public function buildUnixShared(): void
|
||||||
|
{
|
||||||
|
$config = (new SPCConfigUtil($this->builder))->config([$this->getName()]);
|
||||||
|
$env = [
|
||||||
|
'CFLAGS' => $config['cflags'],
|
||||||
|
'CXXFLAGS' => $config['cflags'],
|
||||||
|
'LDFLAGS' => $config['ldflags'],
|
||||||
|
'LIBS' => $config['libs'],
|
||||||
|
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
|
||||||
|
];
|
||||||
|
// prepare configure args
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->setEnv($env)
|
||||||
|
->execWithEnv(BUILD_BIN_PATH . '/phpize')
|
||||||
|
->execWithEnv('./configure ' . $this->getUnixConfigureArg(true) . ' --with-php-config=' . BUILD_BIN_PATH . '/php-config --enable-shared --disable-static')
|
||||||
|
->execWithEnv('make clean')
|
||||||
|
->execWithEnv('make -j' . $this->builder->concurrency)
|
||||||
|
->execWithEnv('make install');
|
||||||
|
|
||||||
|
// check shared extension with php-cli
|
||||||
|
if (file_exists(BUILD_BIN_PATH . '/php')) {
|
||||||
|
$this->runSharedExtensionCheckUnix();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user