Skip to content

Commit

Permalink
[TASK] Silence PHP opcache warnings
Browse files Browse the repository at this point in the history
There are some environments where `opcache.restrict_api`(https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.restrict-api)
is enabled for security/stability reasons. Using them produces PHP warnings like

```
PHP Warning:  Zend OPcache API is restricted by "restrict_api" configuration
directive in /tmp/vendor/typo3/phar-stream-wrapper/src/Helper.php on line 34
```
  • Loading branch information
xknown authored and ohader committed Jun 19, 2020
1 parent 64e39a8 commit 7e832ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public static function resetOpCache()
if (function_exists('opcache_reset')
&& function_exists('opcache_get_status')
) {
$status = opcache_get_status();
$status = @opcache_get_status();
if (!empty($status['opcache_enabled'])) {
opcache_reset();
@opcache_reset();
}
}
}
Expand Down Expand Up @@ -196,4 +196,4 @@ private static function isWindows()
{
return stripos(PHP_OS, 'WIN') === 0;
}
}
}

0 comments on commit 7e832ee

Please sign in to comment.