kernel/private/rest/classes/router.php
protected function getCachedRoutes()
    {
        $ttl = (int)eZINI::instance( 'rest.ini' )->variable( 'CacheSettings', 'RouteApcCacheTTL' );

        if( self::$isRouteCacheCreated === false )
        {
            $options = array( 'ttl' => $ttl );
            ezcCacheManager::createCache( self::ROUTE_CACHE_ID, self::ROUTE_CACHE_PATH, 'ezpRestCacheStorageApcCluster', $options );
            self::$isRouteCacheCreated = true;
        }

        $cache = ezcCacheManager::getCache( self::ROUTE_CACHE_ID );
        $cacheKey = self::ROUTE_CACHE_KEY . '_' . ezpRestPrefixFilterInterface::getApiProviderName();
        if( ( $prefixedRoutes = $cache->restore( $cacheKey ) ) === false )
        {
            try
            {
                $prefixedRoutes = $this->doCreateRoutes();
                $cache->store( $cacheKey, $prefixedRoutes );
            }
            catch( Exception $e )
            {
                // Sometimes APC can miss a write. No big deal, just log it.
                // Cache will be regenerated next time
                ezpRestDebug::getInstance()->log( $e->getMessage(), ezcLog::ERROR );
            }
        }

        return $prefixedRoutes;
    }
protected function getCachedRoutes()
    {
        $ttl = (int)eZINI::instance( 'rest.ini' )->variable( 'CacheSettings', 'RouteApcCacheTTL' );

        if( self::$isRouteCacheCreated === false )
        {
            $options = array( 'ttl' => $ttl );
            ezcCacheManager::createCache( self::ROUTE_CACHE_ID, self::ROUTE_CACHE_PATH, 'ezpRestCacheStorageApcCluster', $options );
            self::$isRouteCacheCreated = true;
        }

        $cache = ezcCacheManager::getCache( self::ROUTE_CACHE_ID );
        $cacheKey = self::ROUTE_CACHE_KEY . '_' . ezpRestPrefixFilterInterface::getApiProviderName();
        if( ( $prefixedRoutes = $cache->restore( $cacheKey ) ) === false )
        {
            try
            {
                $prefixedRoutes = $this->doCreateRoutes();
                $cache->store( $cacheKey, $prefixedRoutes );
            }
            catch( Exception $e )
            {
                // Sometimes APC can miss a write. No big deal, just log it.
                // Cache will be regenerated next time
                ezpRestDebug::getInstance()->log( $e->getMessage(), ezcLog::ERROR );
            }
        }

        return $prefixedRoutes;
    }
protected function getCachedRoutes ( ) { $ ttl = ( int ) eZINI :: instance ( 'rest.ini' ) -> variable ( 'CacheSettings' , 'RouteApcCacheTTL' ) ; if ( self :: $ isRouteCacheCreated === false ) { $ options = array ( 'ttl' => $ ttl ) ; ezcCacheManager :: createCache ( self :: ROUTE_CACHE_ID , self :: ROUTE_CACHE_PATH , 'ezpRestCacheStorageApcCluster' , $ options ) ; self :: $ isRouteCacheCreated = true ; } $ cache = ezcCacheManager :: getCache ( self :: ROUTE_CACHE_ID ) ; $ cacheKey = self :: ROUTE_CACHE_KEY . '_' . ezpRestPrefixFilterInterface :: getApiProviderName ( ) ; if ( ( $ prefixedRoutes = $ cache -> restore ( $ cacheKey ) ) === false ) { try { $ prefixedRoutes = $ this -> doCreateRoutes ( ) ; $ cache -> store ( $ cacheKey , $ prefixedRoutes ) ; } catch ( Exception $ e ) { // Sometimes APC can miss a write. No big deal, just log it. // Cache will be regenerated next time ezpRestDebug :: getInstance ( ) -> log ( $ e -> getMessage ( ) , ezcLog :: ERROR ) ; } } return $ prefixedRoutes ; }
Extract REST routes from APC cache.
Cache is generated if needed
@return array The route objects
Extract REST routes from APC cache . Cache is generated if needed