mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
Refactor all (except command) modules using new exceptions
This commit is contained in:
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\exception\BuildFailureException;
|
||||
|
||||
trait fastlz
|
||||
{
|
||||
protected function build(): void
|
||||
@@ -13,10 +15,10 @@ trait fastlz
|
||||
->exec((getenv('AR') ?: 'ar') . ' rcs libfastlz.a fastlz.o');
|
||||
|
||||
if (!copy($this->source_dir . '/fastlz.h', BUILD_INCLUDE_PATH . '/fastlz.h')) {
|
||||
throw new \RuntimeException('Failed to copy fastlz.h');
|
||||
throw new BuildFailureException('Failed to copy fastlz.h, file does not exist');
|
||||
}
|
||||
if (!copy($this->source_dir . '/libfastlz.a', BUILD_LIB_PATH . '/libfastlz.a')) {
|
||||
throw new \RuntimeException('Failed to copy libfastlz.a');
|
||||
throw new BuildFailureException('Failed to copy libfastlz.a, file does not exist');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ declare(strict_types=1);
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\builder\linux\library\LinuxLibraryBase;
|
||||
use SPC\exception\BuildFailureException;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\SPCTarget;
|
||||
|
||||
@@ -60,7 +60,7 @@ trait postgresql
|
||||
$envs .= " LIBS=\"{$libs}{$libcpp}\" ";
|
||||
}
|
||||
if ($error_exec_cnt > 0) {
|
||||
throw new RuntimeException('Failed to get pkg-config information!');
|
||||
throw new BuildFailureException('Failed to get pkg-config information!');
|
||||
}
|
||||
|
||||
FileSystem::resetDir($this->source_dir . '/build');
|
||||
@@ -74,7 +74,7 @@ trait postgresql
|
||||
->exec('sed -i.backup "278 s/^/# /" ../src/Makefile.shlib')
|
||||
->exec('sed -i.backup "402 s/^/# /" ../src/Makefile.shlib');
|
||||
} else {
|
||||
throw new RuntimeException('Unsupported version for postgresql: ' . $version . ' !');
|
||||
throw new BuildFailureException('Unsupported version for postgresql: ' . $version . ' !');
|
||||
}
|
||||
|
||||
// configure
|
||||
|
||||
Reference in New Issue
Block a user