[wp-trac] [WordPress Trac] #36455: Call opcache_reset() after plug-in, theme or core update

WordPress Trac noreply at wordpress.org
Wed Dec 21 18:01:18 UTC 2016


#36455: Call opcache_reset() after plug-in, theme or core update
-------------------------------------+------------------
 Reporter:  nigro.simone             |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  4.8
Component:  Upgrade/Install          |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  needs-patch 2nd-opinion  |     Focuses:
-------------------------------------+------------------

Comment (by JasWSInc):

 Regarding `opcache.restrict_api`. This INI setting, if not empty, contains
 a filesystem path that effectively becomes a whitelist, and therefore
 blacklists anything outside of the filesystem path given.

 An example value for `opcache.restrict_api` would be something like:
 `opcache.restrict_api = /var/www/html/wp-content/plugins/xyz/`

 Which states that any PHP file that has a filesystem path that begins with
 `/var/www/html/wp-content/plugins/xyz/` is whitelisted. Any that does not,
 is blacklisted.

 So to check this in PHP (against the current `__FILE__`), use something
 like:
 {{{#!php
 <?php
 if(!ini_get('opcache.restrict_api') || stripos(__FILE__,
 ini_get('opcache.restrict_api')) === 0) {
     opcache_reset();
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36455#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list