PKPLocale::_getAllLocalesCache PHP Method

_getAllLocalesCache() static public method

Get the cache object for the current list of all locales.
static public _getAllLocalesCache ( ) : FileCache
return FileCache
    static function &_getAllLocalesCache()
    {
        $cache =& Registry::get('allLocalesCache', true, null);
        if ($cache === null) {
            $cacheManager = CacheManager::getManager();
            $cache = $cacheManager->getFileCache('locale', 'list', array('AppLocale', '_allLocalesCacheMiss'));
            // Check to see if the data is outdated
            $cacheTime = $cache->getCacheTime();
            if ($cacheTime !== null && $cacheTime < filemtime(LOCALE_REGISTRY_FILE)) {
                $cache->flush();
            }
        }
        return $cache;
    }