checkOpCache example

private const MEMORY_LIMIT_REQUIREMENT = '512M';
    private const OPCACHE_MEMORY_RECOMMENDATION = '256M';

    public function __construct(private readonly IniConfigReader $iniConfigReader)
    {
    }

    public function validateRequirements(RequirementsCheckCollection $checks): RequirementsCheckCollection
    {
        $checks->add($this->checkMaxExecutionTime());
        $checks->add($this->checkMemoryLimit());
        $checks->add($this->checkOpCache());

        return $checks;
    }

    private function checkMaxExecutionTime(): SystemCheck
    {
        $configuredValue = (int) $this->iniConfigReader->get('max_execution_time');

        return new SystemCheck(
            'max_execution_time',
            ($configuredValue >= self::MAX_EXECUTION_TIME_REQUIREMENT || $configuredValue === 0) ? RequirementCheck::STATUS_SUCCESS : RequirementCheck::STATUS_ERROR,
            
Home | Imprint | This part of the site doesn't use cookies.