Skip to content

Commit 5b8c9e6

Browse files
committed
we need to change source_path for shared build
1 parent 5d10433 commit 5b8c9e6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/SPC/builder/extension/maxminddb.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55
namespace SPC\builder\extension;
66

77
use SPC\builder\Extension;
8+
use SPC\store\FileSystem;
89
use SPC\util\CustomExt;
910

1011
#[CustomExt('maxminddb')]
1112
class maxminddb extends Extension
1213
{
1314
public function patchBeforeBuildconf(): bool
1415
{
15-
if (!is_link(SOURCE_PATH . '/php-src/ext/maxminddb')) {
16+
if (!is_dir(SOURCE_PATH . '/php-src/ext/maxminddb')) {
1617
$original = $this->source_dir;
17-
if (PHP_OS_FAMILY === 'Windows') {
18-
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && mklink /D maxminddb ' . $original . '\ext');
19-
} else {
20-
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && ln -s ' . $original . '/ext maxminddb');
21-
}
18+
FileSystem::copyDir($original . '/ext', SOURCE_PATH . '/php-src/ext/maxminddb');
19+
$this->source_dir = SOURCE_PATH . '/php-src/ext/maxminddb';
2220
return true;
2321
}
22+
$this->source_dir = SOURCE_PATH . '/php-src/ext/maxminddb';
2423
return false;
2524
}
2625
}

0 commit comments

Comments
 (0)