Skip to content

Commit

Permalink
Additionally silenced opcache status call
Browse files Browse the repository at this point in the history
  • Loading branch information
Rarst committed Jun 16, 2022
1 parent cf1b015 commit e6c172f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Record/Collector/Core_Load_Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ public function get_records(): array {
$php = 'PHP Load – ' . PHP_VERSION;

if ( $this->opcache_api_available() ) {
$zend_status = opcache_get_status();
/**
* This is silenced since it might still emit warning for correct `opcache.resrict_api` configuration.
* @see https://github.com/php/php-src/issues/8799
*/
$zend_status = @opcache_get_status();
$php .= empty( $zend_status['opcache_enabled'] ) ? '' : ' – OPcache';
}

Expand Down Expand Up @@ -67,7 +71,7 @@ private function opcache_api_available(): bool {
/**
* The paths aren't normalized, because it is unclear if they are in PHP itself
* and this should rather be false negative to prevent warning emitted.
*/
*/
return 0 === stripos( __FILE__, $restrict_api );
}
}

0 comments on commit e6c172f

Please sign in to comment.