protected function addCache(Application $app)
    {
        $app['descriptor.cache'] = $app->share(
            function () {
                $cache = new Filesystem();
                $cache->setOptions(
                    array(
                         'namespace' => 'phpdoc-cache',
                         'cache_dir' => sys_get_temp_dir(),
                    )
                );
                $plugin = new SerializerPlugin();

                if (extension_loaded('igbinary')) {
                    $options = new PluginOptions();
                    $options->setSerializer('igbinary');

                    $plugin->setOptions($options);
                }

                $cache->addPlugin($plugin);

                return $cache;
            }
        );
    }
protected function addCache(Application $app)
    {
        $app['descriptor.cache'] = $app->share(
            function () {
                $cache = new Filesystem();
                $cache->setOptions(
                    array(
                         'namespace' => 'phpdoc-cache',
                         'cache_dir' => sys_get_temp_dir(),
                    )
                );
                $plugin = new SerializerPlugin();

                if (extension_loaded('igbinary')) {
                    $options = new PluginOptions();
                    $options->setSerializer('igbinary');

                    $plugin->setOptions($options);
                }

                $cache->addPlugin($plugin);

                return $cache;
            }
        );
    }
protected function addCache ( Application $ app ) { $ app [ 'descriptor.cache' ] = $ app -> share ( function ( ) { $ cache = new Filesystem ( ) ; $ cache -> setOptions ( array ( 'namespace' => 'phpdoc-cache' , 'cache_dir' => sys_get_temp_dir ( ) , ) ) ; $ plugin = new SerializerPlugin ( ) ; if ( extension_loaded ( 'igbinary' ) ) { $ options = new PluginOptions ( ) ; $ options -> setSerializer ( 'igbinary' ) ; $ plugin -> setOptions ( $ options ) ; } $ cache -> addPlugin ( $ plugin ) ; return $ cache ; } ) ; }
Adds the caching mechanism to the dependency injection container with key 'descriptor.cache'.

@param Application $app

@return void
Adds the caching mechanism to the dependency injection container with key descriptor . cache .