mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 08:45:40 +08:00
Add pdo_sqlsrv, libyaml patches from v2
This commit is contained in:
28
src/Package/Extension/yaml.php
Normal file
28
src/Package/Extension/yaml.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Package\Extension;
|
||||
|
||||
use Package\Target\php;
|
||||
use StaticPHP\Attribute\Package\BeforeStage;
|
||||
use StaticPHP\Attribute\Package\Extension;
|
||||
use StaticPHP\Attribute\PatchDescription;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
|
||||
#[Extension('yaml')]
|
||||
class yaml
|
||||
{
|
||||
#[BeforeStage('php', [php::class, 'buildconfForWindows'], 'ext-yaml')]
|
||||
#[PatchDescription('Fix yaml config.w32 to always link against static libyaml on Windows')]
|
||||
public function patchBeforeBuildconfForWindows(): void
|
||||
{
|
||||
// Force static libyaml linkage: config.w32 normally only picks libs ending in '_a.lib',
|
||||
// but libyaml may not follow that naming convention, so we add 'yes' == 'yes' to always match.
|
||||
FileSystem::replaceFileStr(
|
||||
SOURCE_PATH . '/php-src/ext/yaml/config.w32',
|
||||
"lib.substr(lib.length - 6, 6) == '_a.lib'",
|
||||
"lib.substr(lib.length - 6, 6) == '_a.lib' || 'yes' == 'yes'"
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user