Running code before object-cache.php runs

I want to polyfill some functions before object-cache.php runs. I have PHP7 and APCu installed. However, W3 Total Cache is using apc_* functions, not apcu_* functions. W3 Total Cache's object cache runs using object-cache.php, which is loaded before any plugins run.

How can I run custom code before W3 Total Cache runs without modifying WordPress core? I also can't use PHP's auto_prepend_file because WordFence is using it.

Here is the code I want to run:

if (function_exists('apcu_add') && !function_exists('apc_add')) {     function apc_add() {         return call_user_func_array('apcu_add', func_get_args());     }      function apc_cache_info() {         return call_user_func_array('apcu_cache_info', func_get_args());     }      function apc_cas() {         return call_user_func_array('apcu_cas', func_get_args());     }      ... } 

I might just paste it into wp-config.php.


Category: php Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.139 (s). 12 q(s)