| @@ 143-158 (lines=16) @@ | ||
| 140 | * @param int $flag May used by type func. |
|
| 141 | * @return mixed |
|
| 142 | */ |
|
| 143 | public function CacheGet($key, $flag) { |
|
| 144 | // Error check |
|
| 145 | if (empty($this->aCfg['cache-type'])) { |
|
| 146 | $this->Log('Cache type is not set.', 5); |
|
| 147 | return NULL; |
|
| 148 | } |
|
| 149 | ||
| 150 | $s = 'CacheGet' . ucfirst($this->aCfg['cache-type']); |
|
| 151 | if (method_exists($this, $s)) |
|
| 152 | return $this->{$s}($key, $flag); |
|
| 153 | else { |
|
| 154 | $this->Log('Cache get method for type ' |
|
| 155 | . $this->aCfg['cache-type'] . ' not implement.', 5); |
|
| 156 | return NULL; |
|
| 157 | } |
|
| 158 | } // end of func CacheGet |
|
| 159 | ||
| 160 | ||
| 161 | /** |
|
| @@ 238-254 (lines=17) @@ | ||
| 235 | * @param mixed $val |
|
| 236 | * @return $this |
|
| 237 | */ |
|
| 238 | public function CacheSet ($key, $val) { |
|
| 239 | // Error check |
|
| 240 | if (empty($this->aCfg['cache-type'])) { |
|
| 241 | $this->Log('Cache type is not set.', 5); |
|
| 242 | return this; |
|
| 243 | } |
|
| 244 | ||
| 245 | $s = 'CacheSet' . ucfirst($this->aCfg['cache-type']); |
|
| 246 | if (method_exists($this, $s)) { |
|
| 247 | $this->{$s}($key, $val); |
|
| 248 | } |
|
| 249 | else { |
|
| 250 | $this->Log('Cache set method for type ' |
|
| 251 | . $this->aCfg['cache-type'] . ' not implement.', 5); |
|
| 252 | } |
|
| 253 | return $this; |
|
| 254 | } // end of func CacheSet |
|
| 255 | ||
| 256 | ||
| 257 | /** |
|