moorscode / wp-multi-object-cache

Allow for better Object Cache group control
4 stars 1 forks source link

issue when using the default config.php #3

Closed mxmkmarquette closed 7 years ago

mxmkmarquette commented 7 years ago
[11-Apr-2017 09:05:40 UTC] PHP Fatal error:  Uncaught LogicException: The pool PHP must have a "method" defined. in /home/madmax/public_html/neufsvies/wp-content/mu-plugins/wp-multi-object-cache/src/PoolManager.php:85
Stack trace:
#0 /home/madmax/public_html/neufsvies/wp-content/mu-plugins/wp-multi-object-cache/src/PoolManager.php(71): WPMultiObjectCache\PoolManager->registerPool('PHP', Array)
#1 /home/madmax/public_html/neufsvies/wp-content/mu-plugins/wp-multi-object-cache/src/PoolManager.php(37): WPMultiObjectCache\PoolManager->registerPools(Array)
#2 /home/madmax/public_html/neufsvies/wp-content/mu-plugins/wp-multi-object-cache/src/Manager.php(39): WPMultiObjectCache\PoolManager->initialize()
#3 /home/madmax/public_html/neufsvies/wp-content/mu-plugins/wp-multi-object-cache/api.php(14): WPMultiObjectCache\Manager::initialize()
#4 /home/madmax/public_html/wp-includes/load.php(514): wp_cache_init()
#5 /home/madmax/public_html/wp-settings.php(114): wp_start_object_cache()
#6 /home/madmax/public_html/wp-config.php(118): require_once('/home/madmax/pu...')
 in /home/madmax/public_html/neufsvies/wp-content/mu-plugins/wp-multi-object-cache/src/PoolManager.php on line 85

my config files is named accordingly and all server are listening on the good port.

<?php

$config = [
    'pools' => [
        // Default/fallback controller.
        'General'    => [
            'method'        => 'Redis',
            'config'        => [
                'scheme' => 'tcp',
                'host' => '127.0.0.1',
                'port' => 6379
            ],
            'prerequisites' => [
                'class' => 'Redis',
            ],
            'groups'        => [
                ''
            ],
        ],
        'Transients' => [
            'method' => 'Memcached',
            'config'        => [
                'servers' => [
                    [
                        '127.0.0.1',
                        11212
                    ],
                ],
            ],
            'prerequisites' => [
                'class' => 'Memcached',
            ],
            'groups'        => [
                'transient',
                'site-transient',
            ],
        ],
        // Use Non Persistent Pool.
        'PHP'       => [
            'groups' => [
                'non-persistent'
            ],
        ],
    ],
];
mxmkmarquette commented 7 years ago

should that not be

        // Use Non Persistent Pool.
        'PHP'       => [
            'groups' => [
                'non-persistent'
            ],
        ],
        // Use Non Persistent Pool.
        'Non Persistent'       => [
            'method' => 'PHPArray',
            'prerequisites' => [
                'class' => 'PHPArray',
            ],
            'groups' => [
                'non-persistent'
            ],
        ],

or something like that.

moorscode commented 7 years ago

You are totally correct, I have implemented that the default Pool to be used is the PHP Array.

This means that it's not needed in the configuration at all, I will remove it from the sample configuration!

moorscode commented 7 years ago

The example configuration has been modified, non-persistent cache entry has been removed.