EventDispatcher/CleanTranslationCacheListener.php
private function isCacheExpired()
    {
        if (empty($this->cacheInterval)) {
            return true;
        }

        $cache_file = $this->cacheDirectory.'/translations/cache_timestamp';
        $cache_dir  =$this->cacheDirectory.'/translations';
        if ('\\' === DIRECTORY_SEPARATOR) {
            $cache_file = strtr($cache_file, '/', '\\');
            $cache_dir = strtr($cache_dir, '/', '\\');
        }
        if (!\is_dir($cache_dir)) {
            \mkdir($cache_dir);
        }        
        if (!\file_exists($cache_file)) {
            \touch($cache_file);
            return true;
        }
        $expired = false;
        if ((\time() - \filemtime($cache_file)) > $this->cacheInterval) {
            \file_put_contents($cache_file, \time());
            $expired = true;
        }

        return $expired;
    }
private function isCacheExpired()
    {
        if (empty($this->cacheInterval)) {
            return true;
        }

        $cache_file = $this->cacheDirectory.'/translations/cache_timestamp';
        $cache_dir  =$this->cacheDirectory.'/translations';
        if ('\\' === DIRECTORY_SEPARATOR) {
            $cache_file = strtr($cache_file, '/', '\\');
            $cache_dir = strtr($cache_dir, '/', '\\');
        }
        if (!\is_dir($cache_dir)) {
            \mkdir($cache_dir);
        }        
        if (!\file_exists($cache_file)) {
            \touch($cache_file);
            return true;
        }
        $expired = false;
        if ((\time() - \filemtime($cache_file)) > $this->cacheInterval) {
            \file_put_contents($cache_file, \time());
            $expired = true;
        }

        return $expired;
    }
private function isCacheExpired ( ) { if ( empty ( $ this -> cacheInterval ) ) { return true ; } $ cache_file = $ this -> cacheDirectory . '/translations/cache_timestamp' ; $ cache_dir = $ this -> cacheDirectory . '/translations' ; if ( '\\' === DIRECTORY_SEPARATOR ) { $ cache_file = strtr ( $ cache_file , '/' , '\\' ) ; $ cache_dir = strtr ( $ cache_dir , '/' , '\\' ) ; } if ( ! \ is_dir ( $ cache_dir ) ) { \ mkdir ( $ cache_dir ) ; } if ( ! \ file_exists ( $ cache_file ) ) { \ touch ( $ cache_file ) ; return true ; } $ expired = false ; if ( ( \ time ( ) - \ filemtime ( $ cache_file ) ) > $ this -> cacheInterval ) { \ file_put_contents ( $ cache_file , \ time ( ) ) ; $ expired = true ; } return $ expired ; }
Checks if cache has expired

@return boolean
Checks if cache has expired