mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 01:45:36 +08:00
Merge branch 'main' into revert-1153-fix/heif
This commit is contained in:
@@ -333,10 +333,9 @@
|
||||
}
|
||||
},
|
||||
"ext-zstd": {
|
||||
"type": "git",
|
||||
"type": "ghtagtar",
|
||||
"repo": "kjdev/php-ext-zstd",
|
||||
"path": "php-src/ext/zstd",
|
||||
"rev": "master",
|
||||
"url": "https://github.com/kjdev/php-ext-zstd",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('pdo_sqlite')]
|
||||
class pdo_sqlite extends Extension
|
||||
{
|
||||
public function patchBeforeConfigure(): bool
|
||||
{
|
||||
FileSystem::replaceFileRegex(
|
||||
SOURCE_PATH . '/php-src/configure',
|
||||
'/sqlite3_column_table_name=yes/',
|
||||
'sqlite3_column_table_name=no'
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ namespace SPC\builder\extension;
|
||||
use SPC\builder\Extension;
|
||||
use SPC\store\SourcePatcher;
|
||||
use SPC\util\CustomExt;
|
||||
use SPC\util\GlobalEnvManager;
|
||||
|
||||
#[CustomExt('xlswriter')]
|
||||
class xlswriter extends Extension
|
||||
@@ -29,13 +28,6 @@ class xlswriter extends Extension
|
||||
public function patchBeforeMake(): bool
|
||||
{
|
||||
$patched = parent::patchBeforeMake();
|
||||
|
||||
// Remove when https://github.com/viest/php-ext-xlswriter/pull/560 is merged
|
||||
if (PHP_OS_FAMILY !== 'Windows') {
|
||||
GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -std=gnu17');
|
||||
$patched = true;
|
||||
}
|
||||
|
||||
if (PHP_OS_FAMILY === 'Windows') {
|
||||
// fix windows build with openssl extension duplicate symbol bug
|
||||
SourcePatcher::patchFile('spc_fix_xlswriter_win32.patch', $this->source_dir);
|
||||
@@ -48,10 +40,4 @@ class xlswriter extends Extension
|
||||
}
|
||||
return $patched;
|
||||
}
|
||||
|
||||
// Remove when https://github.com/viest/php-ext-xlswriter/pull/560 is merged
|
||||
protected function getExtraEnv(): array
|
||||
{
|
||||
return ['CFLAGS' => '-std=gnu17'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,12 @@ trait sqlite
|
||||
{
|
||||
protected function build(): void
|
||||
{
|
||||
UnixAutoconfExecutor::create($this)->configure()->make();
|
||||
UnixAutoconfExecutor::create($this)
|
||||
->appendEnv([
|
||||
'CFLAGS' => '-DSQLITE_ENABLE_COLUMN_METADATA=1',
|
||||
])
|
||||
->configure()
|
||||
->make();
|
||||
$this->patchPkgconfPrefix(['sqlite3.pc']);
|
||||
}
|
||||
}
|
||||
|
||||
16
src/globals/ext-tests/pdo_sqlite.php
Normal file
16
src/globals/ext-tests/pdo_sqlite.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$pdo = new PDO('sqlite::memory:');
|
||||
$pdo->exec('CREATE TABLE spc_column_metadata_test (id INTEGER)');
|
||||
|
||||
$stmt = $pdo->query('SELECT id FROM spc_column_metadata_test');
|
||||
if ($stmt === false) {
|
||||
throw new RuntimeException('Failed to query SQLite metadata test table.');
|
||||
}
|
||||
|
||||
$metadata = $stmt->getColumnMeta(0);
|
||||
if (($metadata['table'] ?? null) !== 'spc_column_metadata_test') {
|
||||
throw new RuntimeException('PDO SQLite column metadata does not include the origin table.');
|
||||
}
|
||||
10
src/globals/ext-tests/sqlite3.php
Normal file
10
src/globals/ext-tests/sqlite3.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$sqlite = new SQLite3(':memory:');
|
||||
$enabled = $sqlite->querySingle("SELECT sqlite_compileoption_used('ENABLE_COLUMN_METADATA')");
|
||||
|
||||
if ((int) $enabled !== 1) {
|
||||
throw new RuntimeException('SQLite was not built with SQLITE_ENABLE_COLUMN_METADATA.');
|
||||
}
|
||||
Reference in New Issue
Block a user