-
-
Notifications
You must be signed in to change notification settings - Fork 379
Expand file tree
/
Copy pathdecimal.php
More file actions
40 lines (34 loc) · 1.13 KB
/
decimal.php
File metadata and controls
40 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
use SPC\util\CustomExt;
#[CustomExt('decimal')]
class decimal extends Extension
{
// TODO: remove this when https://github.com/php-decimal/ext-decimal/issues/92 is merged
public function patchBeforeBuildconf(): bool
{
FileSystem::replaceFileStr(
$this->source_dir . '/php_decimal.c',
'zend_module_entry decimal_module_entry',
'zend_module_entry php_decimal_module_entry'
);
FileSystem::replaceFileStr(
$this->source_dir . '/config.w32',
'ARG_WITH("decimal", "for decimal support", "no");',
'ARG_WITH("decimal", "for decimal support", "no");' . "\n" .
'ADD_EXTENSION_DEP("decimal", "json");'
);
return true;
}
public function getUnixConfigureArg(bool $shared = false): string
{
return '--enable-decimal --with-libmpdec-path="' . BUILD_ROOT_PATH . '"';
}
public function getWindowsConfigureArg(bool $shared = false): string
{
return '--with-decimal';
}
}