mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 08:15:39 +08:00
Enhance exception handling by binding builder and extra info to ExceptionHandler
This commit is contained in:
@@ -229,6 +229,9 @@ abstract class BuilderBase
|
||||
*/
|
||||
abstract public function testPHP(int $build_target = BUILD_TARGET_NONE);
|
||||
|
||||
/**
|
||||
* Build shared extensions.
|
||||
*/
|
||||
public function buildSharedExts(): void
|
||||
{
|
||||
$lines = file(BUILD_BIN_PATH . '/php-config');
|
||||
|
||||
@@ -8,6 +8,7 @@ use SPC\builder\freebsd\BSDBuilder;
|
||||
use SPC\builder\linux\LinuxBuilder;
|
||||
use SPC\builder\macos\MacOSBuilder;
|
||||
use SPC\builder\windows\WindowsBuilder;
|
||||
use SPC\exception\ExceptionHandler;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
|
||||
@@ -29,6 +30,10 @@ class BuilderProvider
|
||||
'BSD' => new BSDBuilder($input->getOptions()),
|
||||
default => throw new WrongUsageException('Current OS "' . PHP_OS_FAMILY . '" is not supported yet'),
|
||||
};
|
||||
|
||||
// bind the builder to ExceptionHandler
|
||||
ExceptionHandler::$bind_builder = self::$builder;
|
||||
|
||||
return self::$builder;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user