Skip to content

Commit

Permalink
Merge pull request #759 from jeromegamez/urlwildcard_never_cached
Browse files Browse the repository at this point in the history
Fix eZURLWildcard: wildcardsIndex is never cached
  • Loading branch information
andrerom committed Oct 12, 2013
2 parents 19bafa4 + 56bd247 commit 978914c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions kernel/classes/ezurlwildcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,6 @@ protected static function expiryTimestamp()
* Assign function names to input variables. Generates the wildcard cache if
* expired.
*
* @param $regexpArrayCallback function to get an array of regexps
*
* @return array The wildcards index, as an array of regexps
*/
protected static function wildcardsIndex()
Expand All @@ -440,16 +438,16 @@ protected static function wildcardsIndex()
$cacheIndexFile = self::loadCacheFile();

// if NULL is returned, the cache doesn't exist or isn't valid
$wildcardsIndex = $cacheIndexFile->processFile( array( __CLASS__, 'fetchCacheFile' ), self::expiryTimestamp() );
if ( $wildcardsIndex === null )
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
$wildcardsIndex = self::createWildcardsIndex();
self::$wildcardsIndex = self::createWildcardsIndex();
}
}

return $wildcardsIndex;
return self::$wildcardsIndex;
}

/**
Expand All @@ -462,7 +460,8 @@ protected static function wildcardsIndex()
* ...
* 'wildcard_<md5>_N.php': contains cached wildcards.
* Each file has info about eZURLWildcard::WILDCARDS_PER_CACHE_FILE wildcards.
* @return void
*
* @return array
*/
protected static function createWildcardsIndex()
{
Expand Down

0 comments on commit 978914c

Please sign in to comment.