findings = $findings; } public function id(): string { return 'environment.php_limits'; } /** * @return array */ public function execute( string $timestamp ): array { $directives = array( 'memory_limit', 'max_execution_time', 'max_input_time', 'max_input_vars', 'upload_max_filesize', 'post_max_size' ); $observations = array(); foreach ( $directives as $directive ) { $value = ini_get( $directive ); if ( false !== $value ) { $observations[] = array( 'directive' => $directive, 'value' => (string) $value, ); } } $observed = count( $observations ); $total = count( $directives ); $status = 0 === $observed ? 'not_tested' : 'pass'; $coverage = 0 === $observed ? 'none' : ( $observed === $total ? 'complete' : 'partial' ); return $this->findings->build( $this->id(), $status, array( 'observations' => $observations, 'method' => 'ini_get_allowlist', 'limitations' => array( 'Values are inventory; suitability depends on site workload and host policy.' ), ), $observed, $total, $coverage, $timestamp ); } }