| @@ 285-299 (lines=15) @@ | ||
| 282 | * |
|
| 283 | * @since 1.0 |
|
| 284 | */ |
|
| 285 | private function HTMLCache() |
|
| 286 | { |
|
| 287 | // check to ensure that the article is not transient before caching it |
|
| 288 | if ($this->BO->getID() != '00000000000') { |
|
| 289 | $fp = fopen($this->HTMLFilename, 'w'); |
|
| 290 | if (!$fp) { |
|
| 291 | throw new AlphaException('Failed to open the cache file for writing, directory permissions my not be set correctly!'); |
|
| 292 | } else { |
|
| 293 | flock($fp, 2); // locks the file for writting |
|
| 294 | fwrite($fp, $this->content); |
|
| 295 | flock($fp, 3); // unlocks the file |
|
| 296 | fclose($fp); //closes the file |
|
| 297 | } |
|
| 298 | } |
|
| 299 | } |
|
| 300 | ||
| 301 | /** |
|
| 302 | * Used to check the HTML cache for the BO cache file. |
|
| @@ 212-226 (lines=15) @@ | ||
| 209 | * |
|
| 210 | * @since 1.0 |
|
| 211 | */ |
|
| 212 | private function cache() |
|
| 213 | { |
|
| 214 | // check to ensure that the article is not transient before caching it |
|
| 215 | if (!$this->BO->isTransient() && $this->filename != '') { |
|
| 216 | $fp = fopen($this->filename, 'w'); |
|
| 217 | if (!$fp) { |
|
| 218 | throw new AlphaException('Failed to open the cache file for writing, directory permissions my not be set correctly!'); |
|
| 219 | } else { |
|
| 220 | flock($fp, 2); // locks the file for writting |
|
| 221 | fwrite($fp, $this->content); |
|
| 222 | flock($fp, 3); // unlocks the file |
|
| 223 | fclose($fp); //closes the file |
|
| 224 | } |
|
| 225 | } |
|
| 226 | } |
|
| 227 | ||
| 228 | /** |
|
| 229 | * Used to check the HTML cache for the BO cache file. |
|