mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
27 lines
708 B
PHP
27 lines
708 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace SPC\builder\extension;
|
||
|
|
|
||
|
|
use SPC\builder\Extension;
|
||
|
|
use SPC\util\CustomExt;
|
||
|
|
|
||
|
|
#[CustomExt('maxminddb')]
|
||
|
|
class maxminddb extends Extension
|
||
|
|
{
|
||
|
|
public function patchBeforeBuildconf(): bool
|
||
|
|
{
|
||
|
|
if (!is_link(SOURCE_PATH . '/php-src/ext/maxminddb')) {
|
||
|
|
$original = $this->source_dir;
|
||
|
|
if (PHP_OS_FAMILY === 'Windows') {
|
||
|
|
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && mklink /D maxminddb ' . $original . '\ext');
|
||
|
|
} else {
|
||
|
|
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && ln -s ' . $original . '/ext maxminddb');
|
||
|
|
}
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|