mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 07:15:38 +08:00
Add php-src/config.log for SPCException
This commit is contained in:
@@ -6,6 +6,7 @@ namespace SPC\builder\unix;
|
||||
|
||||
use SPC\builder\BuilderBase;
|
||||
use SPC\builder\linux\SystemUtil as LinuxSystemUtil;
|
||||
use SPC\exception\SPCException;
|
||||
use SPC\exception\SPCInternalException;
|
||||
use SPC\exception\ValidationException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
@@ -338,4 +339,20 @@ abstract class UnixBuilderBase extends BuilderBase
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seek php-src/config.log when building PHP, add it to exception.
|
||||
*/
|
||||
protected function seekPhpSrcLogFileOnException(callable $callback): void
|
||||
{
|
||||
try {
|
||||
$callback();
|
||||
} catch (SPCException $e) {
|
||||
if (file_exists(SOURCE_PATH . '/php-src/config.log')) {
|
||||
$e->addExtraLogFile('php-src config.log', 'php-src.config.log');
|
||||
copy(SOURCE_PATH . '/php-src/config.log', SPC_LOGS_DIR . '/php-src.config.log');
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user