Prado\I18N\core\TCache_Lite::_setFileName PHP Метод

_setFileName() публичный Метод

Make a file name (with path)
public _setFileName ( string $id, string $group )
$id string cache id
$group string name of the group
    function _setFileName($id, $group)
    {
        if ($this->_fileNameProtection) {
            $this->_file = $this->_cacheDir . 'cache_' . md5($group) . '_' . md5($id);
        } else {
            $this->_file = $this->_cacheDir . 'cache_' . $group . '_' . $id;
        }
    }

Usage Example

Пример #1
0
 /**
  * Get the data from the cache.
  * @param string $catalogue The translation section.
  * @param string $culture The translation locale, e.g. "en_AU".
  * @param string $filename If the source is a file, this file's modified
  * time is newer than the cache's modified time, no cache hit.
  * @return mixed Boolean FALSE if no cache hit. Otherwise, translation
  * table data for the specified section and locale.
  */
 public function get($catalogue, $culture, $lastmodified = 0)
 {
     $ID = $this->getID($catalogue, $culture);
     $group = $this->getGroup($catalogue, $culture);
     $this->cache->_setFileName($ID, $group);
     $cache = $this->cache->getCacheFile();
     if (is_file($cache) == false) {
         return false;
     }
     $lastmodified = (int) $lastmodified;
     if ($lastmodified <= 0 || $lastmodified > filemtime($cache)) {
         return false;
     }
     //echo '@@ Cache hit: "'.$ID.'" : "'.$group.'"';
     //echo "<br>\n";
     return $this->cache->get($ID, $group);
 }