|
@@ 242-252 (lines=11) @@
|
| 239 |
|
* |
| 240 |
|
* @return bool |
| 241 |
|
*/ |
| 242 |
|
protected function hasStaticPage() { |
| 243 |
|
if(!self::config()->enable_static_file) { |
| 244 |
|
return false; |
| 245 |
|
} |
| 246 |
|
|
| 247 |
|
// Attempt to retrieve content from generated file handler |
| 248 |
|
$filename = $this->getErrorFilename(); |
| 249 |
|
$storeFilename = File::join_paths(self::config()->store_filepath, $filename); |
| 250 |
|
$result = self::get_asset_handler()->getContent($storeFilename); |
| 251 |
|
return !empty($result); |
| 252 |
|
} |
| 253 |
|
|
| 254 |
|
/** |
| 255 |
|
* Write out the published version of the page to the filesystem |
|
@@ 300-312 (lines=13) @@
|
| 297 |
|
* @param int $statusCode A HTTP Statuscode, typically 404 or 500 |
| 298 |
|
* @return string|null |
| 299 |
|
*/ |
| 300 |
|
public static function get_content_for_errorcode($statusCode) { |
| 301 |
|
if(!self::config()->enable_static_file) { |
| 302 |
|
return null; |
| 303 |
|
} |
| 304 |
|
|
| 305 |
|
// Attempt to retrieve content from generated file handler |
| 306 |
|
$filename = self::get_error_filename($statusCode); |
| 307 |
|
$storeFilename = File::join_paths( |
| 308 |
|
self::config()->store_filepath, |
| 309 |
|
$filename |
| 310 |
|
); |
| 311 |
|
return self::get_asset_handler()->getContent($storeFilename); |
| 312 |
|
} |
| 313 |
|
|
| 314 |
|
/** |
| 315 |
|
* Gets the filename identifier for the given error code. |