36 lines
757 B
PHP
Raw Normal View History

2023-05-17 15:24:45 +08:00
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
2023-12-10 18:27:52 +08:00
use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
2023-05-17 15:24:45 +08:00
use SPC\util\CustomExt;
#[CustomExt('opcache')]
class opcache extends Extension
{
2023-12-10 18:27:52 +08:00
/**
* @throws WrongUsageException
* @throws RuntimeException
*/
public function validate(): void
2023-12-10 18:27:52 +08:00
{
if ($this->builder->getPHPVersionID() < 80000) {
throw new WrongUsageException('Statically compiled PHP with Zend Opcache only available for PHP >= 8.0 !');
}
}
public function getUnixConfigureArg(): string
{
2023-12-10 18:27:52 +08:00
return '--enable-opcache';
}
2023-05-17 15:24:45 +08:00
public function getDistName(): string
{
return 'Zend Opcache';
}
}