Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

memcached changes #2876

Closed
wants to merge 5 commits into from
Closed

memcached changes #2876

wants to merge 5 commits into from

Conversation

marc-mabe
Copy link
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 ;)

 - 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"
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants