Changeset 9924

Show
Ignore:
Timestamp:
11/14/08 09:06:51 (2 months ago)
Author:
afz
Message:

enhance file cache engine

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/0.8/jaws/html/include/Jaws/Cache/File.php

    r9917 r9924  
    3636    function set($component, $section, $params, &$data, $lifetime = 0) 
    3737    { 
     38        if (!is_null($params)) { 
     39            $params = is_array($params)? implode('_', $params) : $params; 
     40        } else { 
     41            $params = ''; 
     42        } 
     43 
    3844        $file = $this->_path. $component. '.'. $section. (is_null($params)? '' : ('.'. $params)); 
    3945        return (bool) Jaws_Utils::file_put_contents($file, $data); 
     
    4753    function get($component, $section, $params = null) 
    4854    { 
    49         $file = $this->_path. $component. '.'. $section. (is_null($params)? '' : ('.'. $params)); 
     55        if (!is_null($params)) { 
     56            $params = is_array($params)? implode('_', $params) : $params; 
     57        } else { 
     58            $params = ''; 
     59        } 
     60 
     61        $file = $this->_path. $component. '.'. $section. (empty($params)? '' : ('.'. $params)); 
    5062        $res = @file_get_contents($file); 
    5163        return ($res === false) ? null : $res; 
     
    5971    function delete($component = null, $section = null, $params = null) 
    6072    { 
     73        if (!is_null($params)) { 
     74            $params = is_array($params)? implode('_', $params) : $params; 
     75        } else { 
     76            $params = ''; 
     77        } 
     78 
    6179        require_once 'File/Find.php'; 
    6280        $match  = is_null($component)? '' : $component;