mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
add micro php version limit
This commit is contained in:
parent
4edd05f4df
commit
9ce92e39d5
@ -46,7 +46,7 @@ chmod +x spc
|
|||||||
- [X] macOS support
|
- [X] macOS support
|
||||||
- [X] Exception handler
|
- [X] Exception handler
|
||||||
- [ ] Windows support
|
- [ ] Windows support
|
||||||
- [ ] PHP 7.4 support
|
- [X] PHP 7.4 support
|
||||||
|
|
||||||
## Supported Extensions (WIP)
|
## Supported Extensions (WIP)
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ chmod +x spc
|
|||||||
- [X] macOS 支持
|
- [X] macOS 支持
|
||||||
- [ ] Windows 支持
|
- [ ] Windows 支持
|
||||||
- [ ] Linux 支持
|
- [ ] Linux 支持
|
||||||
- [ ] PHP 7.4 支持
|
- [X] PHP 7.4 支持
|
||||||
|
|
||||||
## 支持的扩展情况(WIP)
|
## 支持的扩展情况(WIP)
|
||||||
|
|
||||||
|
|||||||
@ -66,4 +66,4 @@
|
|||||||
|
|
||||||
## Bugs
|
## Bugs
|
||||||
|
|
||||||
See #32.
|
See [#32](https://github.com/crazywhalecc/static-php-cli/issues/32).
|
||||||
|
|||||||
@ -219,6 +219,9 @@ class MacOSBuilder extends BuilderBase
|
|||||||
*/
|
*/
|
||||||
public function buildMicro(string $extra_libs): void
|
public function buildMicro(string $extra_libs): void
|
||||||
{
|
{
|
||||||
|
if ($this->getPHPVersionID() < 80000) {
|
||||||
|
throw new RuntimeException('phpmicro only support PHP >= 8.0!');
|
||||||
|
}
|
||||||
if ($this->getExt('phar')) {
|
if ($this->getExt('phar')) {
|
||||||
$this->phar_patched = true;
|
$this->phar_patched = true;
|
||||||
try {
|
try {
|
||||||
@ -260,4 +263,11 @@ class MacOSBuilder extends BuilderBase
|
|||||||
'strip sapi/cli/php'
|
'strip sapi/cli/php'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPHPVersionID(): int
|
||||||
|
{
|
||||||
|
$file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h');
|
||||||
|
preg_match('/PHP_VERSION_ID (\d+)/', $file, $match);
|
||||||
|
return intval($match[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,8 +77,8 @@ class BuildCliCommand extends BuildCommand
|
|||||||
if ($input->getOption('debug')) {
|
if ($input->getOption('debug')) {
|
||||||
ExceptionHandler::getInstance()->handle($e);
|
ExceptionHandler::getInstance()->handle($e);
|
||||||
} else {
|
} else {
|
||||||
logger()->emergency('Build failed, please check terminal output, or build with --debug option to see more details.');
|
logger()->critical('Build failed, please check terminal output, or build with --debug option to see more details.');
|
||||||
logger()->emergency($e->getMessage());
|
logger()->critical($e->getMessage());
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user