Example #1
0
    /**
     * Expires the wildcard cache. This causes the wildcard cache to be
     * regenerated on the next page load.
     * @return void
     */
    public static function expireCache()
    {
        $handler = eZExpiryHandler::instance();
        $handler->setTimestamp( self::CACHE_SIGNATURE, time() );
        $handler->store();

        self::$wildcardsIndex = null;
    }
 /**
  * Assign function names to input variables. Generates the wildcard cache if
  * expired.
  *
  * @return array The wildcards index, as an array of regexps
  */
 protected static function wildcardsIndex()
 {
     if (self::$wildcardsIndex === null) {
         $cacheIndexFile = self::loadCacheFile();
         // if NULL is returned, the cache doesn't exist or isn't valid
         self::$wildcardsIndex = $cacheIndexFile->processFile(array(__CLASS__, 'fetchCacheFile'), self::expiryTimestamp());
         if (self::$wildcardsIndex === null) {
             // This will generate and return the index, and store the cache
             // files for the different wildcards for later use
             self::$wildcardsIndex = self::createWildcardsIndex();
         }
     }
     return self::$wildcardsIndex;
 }