Bug #4602

memcache doesn't work

Added by Irene Höppner almost 12 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Must have
Category:
Cache
Start date:
2009-09-12
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

I tried to use memcache for parts of the cache.

Added the following configuration to Caches.yaml:

Default:
  backend: F3\FLW3\Cache\Backend\MemcachedBackend
  backendOptions:
    defaultLifetime: 0
    Servers: [localhost:11211]

This error occurs:

Fatal error: Call to a member function getScriptPathAndFilename() on a non-object in C:\Programme\xampp\htdocs\f3\intranet\Packages\Framework\FLOW3\Classes\Cache\Backend\MemcachedBackend.php on line 175

To check, wether the memcached-server is up and running, I used the following PHP-script:

<?php

$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");

$version = $memcache->getVersion();
echo "Server's version: ".$version."<br/>\n";

$tmp_object = new stdClass;
$tmp_object->str_attr = 'test';
$tmp_object->int_attr = 123;

$memcache->set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");
echo "Store data in the cache (data will expire in 10 seconds)<br/>\n";

$get_result = $memcache->get('key');
echo "Data from the cache:<br/>\n";

var_dump($get_result);

?>

The result is:

Server's version: 1.2.1
Store data in the cache (data will expire in 10 seconds)
Data from the cache:
object(stdClass)#3 (2) { ["str_attr"]=> string(4) "test" ["int_attr"]=> int(123) }

#1

Updated by Karsten Dambekalns over 11 years ago

  • Category set to Cache
  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
  • Target version set to 1.0 alpha 5
#2

Updated by Karsten Dambekalns over 11 years ago

First issue: Objects.yaml misses the dependencies for the backend, autowiring is off. Solved.
Next issue: Settings default options breaks with backends that don't support them... bah!

I'm at it...

#3

Updated by Karsten Dambekalns over 11 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r3210.

Also available in: Atom PDF