Файл: system/classes/dizkod/Errors.php
Строк: 17
<?defined('SYSPATH') or die('<b>403<br />Запрет доступа</b>');
class dizkod_Errors{
protected static $err = null;
private static $list_error = array
(
'400' => '400',
'401' => '401',
'402' => '402',
'403' => '403',
'404' => '404',
'405' => '405',
'406' => '406',
'407' => '407',
'408' => '408',
'409' => '409',
'410' => '410',
'411' => '411',
'412' => '412',
'413' => '413',
'414' => '414',
'415' => '415',
'416' => '416',
'417' => '417',
'500' => '500',
'501' => '501',
'502' => '502',
'503' => '503',
'504' => '504',
'505' => '505'
);
function __construct(){}
public static function __err($arg)
{
if(empty(self::$list_error[$arg]))
{
$arg = 404;
}
self::$err = $arg;
self::value();
}
private static function value()
{
if(empty(self::$err))
{
DIE("Не известная ошибка!");
}
if(!is_numeric(self::$err))
{
DIE("Не известная ошибка!");
}
$exep = include(SYSPATH."error/".self::$err.EXT);
echo '<p align="center">'.$exep.'</p>';
exit;
}
public static function __echo($msg)
{
if(empty($msg))
{
exit( "Неизвестная ошибка!");
}
$tpl=new View();
$tpl->display($msg,$msg,"error");
exit;
}
}