Automattic / wp-memcached

Memcached Object Cache for WordPress.
https://wordpress.org/plugins/memcached/
GNU General Public License v2.0
157 stars 55 forks source link

Disabled on development environment #122

Closed alexbogias closed 1 year ago

alexbogias commented 1 year ago

Is there any way to include object-cache.php file in repository and disable it in development environment with a constant or something?

mjangda commented 1 year ago

Something like this could work:

  1. Take the object-cache.php file from this repo, add it to wp-content with the name wp-memcached.php.

  2. Then, add an object-cache.php file in the folder with something like this:

<?php

if ( defined( 'YOUR_CONSTANT_NAME' ) && true === YOUR_CONSTANT_NAME ) {
    return;
}

require __DIR__ . '/wp-memcached.php';
alexbogias commented 1 year ago

Evil Smart!