Skip to content
Permalink
Browse files

Merge pull request #1173 from joaoinacio/EZP-24419_active_extensions_…

…cache

Fix EZP-24419: clear stale active_extension cache files.
  • Loading branch information...
João Inácio
João Inácio committed Jun 2, 2015
2 parents 54eb829 + 46ec17a commit a791be9b80444fab806879c7a566c006ce618044
Showing with 18 additions and 0 deletions.
  1. +1 −0 kernel/classes/ezcache.php
  2. +17 −0 lib/ezutils/classes/ezextension.php
@@ -781,6 +781,7 @@ static function clearActiveExtensions( $cacheItem )
$handler->setTimestamp( $cacheItem['expiry-key'], time() );
$handler->store();
eZExtension::clearActiveExtensionsCache();
eZExtension::clearActiveExtensionsMemoryCache();
}
@@ -585,6 +585,23 @@ public static function clearActiveExtensionsMemoryCache()
{
self::$activeExtensionsCache = array();
}
/**
* Clears (removes) active extension cache files from the cache folder.
* @return void
*/
public static function clearActiveExtensionsCache()
{
$filesList = glob( self::CACHE_DIR . 'active_extensions_*.php' );
foreach ( $filesList as $path )
{
if ( is_file( $path ) )
{
$handler = eZFileHandler::instance( false );
$handler->unlink( $path );
}
}
}
}
?>

0 comments on commit a791be9

Please sign in to comment.
You can’t perform that action at this time.