mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 16:55:38 +08:00
add xdebug dynamic extension
This commit is contained in:
11
src/SPC/builder/extension/xdebug.php
Normal file
11
src/SPC/builder/extension/xdebug.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\util\DynamicExt;
|
||||
|
||||
#[DynamicExt]
|
||||
class xdebug extends Extension {}
|
||||
15
src/SPC/builder/linux/library/xdebug.php
Normal file
15
src/SPC/builder/linux/library/xdebug.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
use SPC\util\DynamicExt;
|
||||
|
||||
#[DynamicExt]
|
||||
class xdebug extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\xdebug;
|
||||
|
||||
public const NAME = 'xdebug';
|
||||
}
|
||||
26
src/SPC/builder/unix/library/xdebug.php
Normal file
26
src/SPC/builder/unix/library/xdebug.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
|
||||
trait xdebug
|
||||
{
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
public function build(): void
|
||||
{
|
||||
shell()->cd($this->source_dir)
|
||||
->exec(BUILD_BIN_PATH . '/phpize')
|
||||
->exec('./configure --with-php-config=' . BUILD_BIN_PATH . '/php-config')
|
||||
->exec('make clean')
|
||||
->exec("make -j{$this->builder->concurrency}");
|
||||
copy($this->source_dir . '/modules/xdebug.so', BUILD_LIB_PATH . '/xdebug.so');
|
||||
copy($this->source_dir . '/modules/xdebug.la', BUILD_LIB_PATH . '/xdebug.la');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user