Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grav Memcached call connect / addServer #1020

Closed
armouredking opened this issue Sep 2, 2016 · 1 comment
Closed

Grav Memcached call connect / addServer #1020

armouredking opened this issue Sep 2, 2016 · 1 comment
Labels

Comments

@armouredking
Copy link

Grav appears to be making an improper call that ( at least in my environment ) prevents it from working.

Standard zip install using 1.1.3 zip file results in the following when attempting to configure memcached:

Whoops \ Exception \ ErrorException (E_ERROR)
Call to undefined method Memcached::connect()

0 Whoops\Exception\ErrorException 
…/­system/­src/­Grav/­Common/­Cache.php186

            case 'memcached':
                $memcached = new \Memcached();
                $memcached->connect($this->config->get('system.cache.memcached.server', 'localhost'),
                    $this->config->get('system.cache.memcached.port', 11211));
                $driver = new DoctrineCache\MemcachedCache();
                $driver->setMemcached($memcached);
                break;

Per this discussion at StackOverflow I make the following change to line 186:

$memcached->connect($this->config->get('system.cache.memcached.server', 'localhost'),

becomes

$memcached->addServer($this->config->get('system.cache.memcached.server', 'localhost'),

System functionality is immediately restored.

@rhukster
Copy link
Member

rhukster commented Sep 2, 2016

Will fix. Thanks!

@rhukster rhukster added the bug label Sep 2, 2016
rhukster added a commit that referenced this issue Sep 2, 2016
@rhukster rhukster closed this as completed Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants