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 a7b56de commit 81a713c
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')
&& !empty(opcache_get_status()['opcache_enabled'])
&& !empty(@opcache_get_status()['opcache_enabled'])
) {
opcache_reset();
@opcache_reset();
}
}

Expand Down Expand Up @@ -195,4 +195,4 @@ private static function isWindows(): bool
{
return stripos(PHP_OS, 'WIN') === 0;
}
}
}

0 comments on commit 81a713c

Please sign in to comment.