Exemple #1
0
 // Storage vars
 $last_modified = $output_data = null;
 // If there's a cache file, read it
 if (hasCache($cache_lang) && !$is_developer) {
     $last_modified = filemtime(pathCache($cache_lang));
     $cache_read = readCache($cache_lang);
     if ($deflate_support || !$has_compression) {
         $output_data = $cache_read;
     } else {
         $output_data = gzinflate($cache_read);
     }
 } else {
     // First try to read the cache reference
     if (hasCache($cache_hash) && !$is_developer) {
         // Read the reference
         $last_modified = filemtime(pathCache($cache_hash));
         $cache_reference = readCache($cache_hash);
         // Filter the cache reference
         if ($has_compression) {
             $output = gzinflate($cache_reference);
         } else {
             $output = $cache_reference;
         }
     } else {
         // Last modified date is now
         $last_modified = time();
         // Initialize the loop
         $looped = '';
         // Add the content of the current file
         foreach ($array as $current) {
             $looped .= rmBOM(file_get_contents($dir . $current)) . "\n";
function readCache($hash)
{
    return file_get_contents(pathCache($hash));
}