[wp-trac] [WordPress Trac] #39132: WP 4.7 breaks if APC is not enabled in php
WordPress Trac
noreply at wordpress.org
Wed Dec 7 03:18:44 UTC 2016
#39132: WP 4.7 breaks if APC is not enabled in php
----------------------------+-----------------------------
Reporter: innocuo | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bootstrap/Load | Version: 4.7
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------------------
'''This happens if PHP doesn't have APC enabled.'''
In wp-includes/object-cache.php: the code checks if APC is enabled, by
checking the existence of the function 'apc_fetch'. If it isn't, then it
sets $GLOBALS`['_wp_using_ext_object_cache']` to false, and manually adds
a filter to $wp_filter`['all']` , like this:
{{{#!php
$GLOBALS['wp_filter']['all'][-100]['apc_not_actually_running'] = array(
'function' => 'apc_not_actually_running', 'accepted_args' => 0 );
}}}
Then, when _wp_call_all_hook() is called (this is in wp-
includes/plugin.php), the code breaks.
This happens because it does this:
{{{#!php
$wp_filter['all']->do_all_hook( $args );
}}}
meaning, it expects $wp_filter`['all']` to be a WP_Hook object, but it is
an array due to the override that happened in object-cache.php (mentioned
above).
An "solution" for users would be to install and enable APC on php,
or comment the line that adds the filter as an array in object-cache.php
(line 667 in the latest version). The real solution would be to add this
filter using/via WP_Hook?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39132>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list