src/RznViewComponent/Service/CacheFactory.php
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $serviceLocator->get('config');
        if (isset($config['rznviewcomponent']['cache_adapter']))
        {
            $config = $config['rznviewcomponent']['cache_adapter'];
        }
        else
            $config = array(
                'name' => 'filesystem',
                'options' => array(
                    'ttl' => 3600,
                    'dirLevel' => 2,
                    'file_locking' => false,
                    'cacheDir' => 'data/cache',
                    'dirPermission' => 0755,
                    'filePermission' => 0666,
                ),
            );

        return \Zend\Cache\StorageFactory::factory(
            array(
                'adapter' => $config,
                'plugins' => array('serializer'),
            )
        );
    }
public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
    {
        $config = $serviceLocator->get('config');
        if (isset($config['rznviewcomponent']['cache_adapter']))
        {
            $config = $config['rznviewcomponent']['cache_adapter'];
        }
        else
            $config = array(
                'name' => 'filesystem',
                'options' => array(
                    'ttl' => 3600,
                    'dirLevel' => 2,
                    'file_locking' => false,
                    'cacheDir' => 'data/cache',
                    'dirPermission' => 0755,
                    'filePermission' => 0666,
                ),
            );

        return \Zend\Cache\StorageFactory::factory(
            array(
                'adapter' => $config,
                'plugins' => array('serializer'),
            )
        );
    }
Create service with name

@param ServiceLocatorInterface $serviceLocator
@param $name
@param $requestedName
@return mixed