mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
add extension xhprof
This commit is contained in:
parent
db7532cad3
commit
cbfbec41b4
@ -479,6 +479,13 @@
|
||||
"libuv"
|
||||
]
|
||||
},
|
||||
"xhprof": {
|
||||
"type": "external",
|
||||
"source": "xhprof",
|
||||
"ext-depends": [
|
||||
"ctype"
|
||||
]
|
||||
},
|
||||
"xlswriter": {
|
||||
"type": "external",
|
||||
"source": "xlswriter",
|
||||
|
||||
@ -532,6 +532,16 @@
|
||||
"path": "COPYING"
|
||||
}
|
||||
},
|
||||
"xhprof": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/xhprof",
|
||||
"path": "php-src/ext/xhprof-src",
|
||||
"filename": "xhprof.tgz",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"xlswriter": {
|
||||
"type": "url",
|
||||
"url": "https://pecl.php.net/get/xlswriter",
|
||||
|
||||
33
src/SPC/builder/extension/xhprof.php
Normal file
33
src/SPC/builder/extension/xhprof.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
#[CustomExt('xhprof')]
|
||||
class xhprof extends Extension
|
||||
{
|
||||
public function patchBeforeBuildconf(): bool
|
||||
{
|
||||
if (!is_link(SOURCE_PATH . '/php-src/ext/xhprof')) {
|
||||
if (PHP_OS_FAMILY === 'Windows') {
|
||||
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && mklink /D xhprof xhprof-src\extension');
|
||||
} else {
|
||||
f_passthru('cd ' . SOURCE_PATH . '/php-src/ext && ln -s xhprof-src/extension xhprof');
|
||||
}
|
||||
|
||||
// patch config.m4
|
||||
FileSystem::replaceFileStr(
|
||||
SOURCE_PATH . '/php-src/ext/xhprof/config.m4',
|
||||
'if test -f $phpincludedir/ext/pcre/php_pcre.h; then',
|
||||
'if test -f $abs_srcdir/ext/pcre/php_pcre.h; then'
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user