-
-
Save basz/2053059 to your computer and use it in GitHub Desktop.
Instantiating Zend Cache Adapter using Factory through Di
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'di' => array( | |
'definition' => array( | |
'class' => array( | |
'Zend\Cache\StorageFactory' => array( | |
'methods' => array( | |
'factory' => array( | |
'cfg' => array( | |
'required' => true, | |
), | |
), | |
), | |
), | |
'Zend\Cache\Storage\Adapter\Memcached' => array( | |
'instantiator' => array( | |
'Zend\Cache\StorageFactory', | |
'factory', | |
), | |
), | |
), | |
), | |
'instance' => array( | |
'alias' => array( | |
'service-cache' => 'Zend\Cache\Storage\Adapter\Memcached', | |
), | |
// Setup the service cache | |
'service-cache' => array( | |
'parameters' => array( | |
'cfg' => array( | |
'adapter' => array( | |
'name' => 'Zend\Cache\Storage\Adapter\Memcached', | |
'options' => array( | |
'namespace' => 'phantom-services', | |
'ttl' => 3600, | |
), | |
), | |
'plugins' => array( | |
'serializer', | |
), | |
), | |
), | |
), | |
), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment