mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
opcache limit php version
This commit is contained in:
parent
c7e9294908
commit
f0319de93e
@ -228,7 +228,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"opcache": {
|
"opcache": {
|
||||||
"type": "builtin"
|
"type": "builtin",
|
||||||
|
"arg-type": "custom"
|
||||||
},
|
},
|
||||||
"openssl": {
|
"openssl": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
|
|||||||
@ -5,11 +5,25 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
|
use SPC\exception\RuntimeException;
|
||||||
|
use SPC\exception\WrongUsageException;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
#[CustomExt('opcache')]
|
#[CustomExt('opcache')]
|
||||||
class opcache extends Extension
|
class opcache extends Extension
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @throws WrongUsageException
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
public function getUnixConfigureArg(): string
|
||||||
|
{
|
||||||
|
if ($this->builder->getPHPVersionID() < 80000) {
|
||||||
|
throw new WrongUsageException('Statically compiled PHP with Zend Opcache only available for PHP >= 8.0 !');
|
||||||
|
}
|
||||||
|
return '--enable-opcache';
|
||||||
|
}
|
||||||
|
|
||||||
public function getDistName(): string
|
public function getDistName(): string
|
||||||
{
|
{
|
||||||
return 'Zend Opcache';
|
return 'Zend Opcache';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user