memcached changes #2876

Closed
wants to merge 5 commits into from

2 participants

@marc-mabe
Zend Framework member
  • implemented namespace support manually to not change Memcached::OPT_PREFIX_KEY on a shared memcached resource
  • added Zend\Cache\Storage\Adapter\MemcachedResourceManager that handles memcached resources

    • an instance of it can be given as a storage option resource_manager else it will be auto-instantiated by MemcachedOptions
    • memcached configuration options will be directed into the resource menager
    • it will lazy load the memcached resource by sharing it over adapters
    • it supports to change resource options after instantiating a resource
  • removed the default server configuration 127.0.0.1:11211

    • could result in a connection to a wrong server be simply forget configuring it
    • memcached as a local only server doesn't make sense because it's better to storare into memory directly in such cases ( like APC )
  • support persistent connections persistent_id
  • changed default weight to 0 ( defined by Memcached::addServer )

It should be backward compatible but some methods of MemcachedOptions marked deprecated:

  • getMemcachedResource setMemcachedResource Please use the resource manager instead
  • addServer Please use the resource manager instead
  • getLibOption setLibOption Please use lib_options or the resource manager instead

Open for discussion ;)

marc-mabe added some commits Oct 31, 2012
@marc-mabe marc-mabe Memcached:
 - fixed some small issues on sharing memcached resources over different instances of Zend\Cache\Storage\Adapter\Memcached
   - implemented namespace support manually to not change Memcached::OPT_PREFIX_KEY on a memcached resource
   - added Zend\Cache\Storage\Adapter\MemcachedResourceManager that handles memcached resources
 - removed the default server configuration (127.0.0.1:11211)
 - added an option to create persistent connections "persistent_id"
482014a
@marc-mabe marc-mabe removed not needed use statement 9b3c775
@marc-mabe marc-mabe fixed wrong doc-comment 5e325d4
@marc-mabe marc-mabe Added E_USER_DEPRECATED errors ed77995
@marc-mabe marc-mabe Fixed use statement 6e9b613
@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@weierophinney weierophinney Merge branch 'feature/memcached-improvements' into develop
Close #2876
c4561e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment