/** * ========================================================== * RENDER A 404 PAGE * ========================================================== * * -- CODE: ------------------------------------------------- * * Shield::abort(); * * ---------------------------------------------------------- * * Shield::abort('404-custom'); * * ---------------------------------------------------------- * */ public static function abort($name = '404', $fallback = false, $buffer = true) { $s = explode('-', $name, 2); $s = is_numeric($s[0]) ? $s[0] : '404'; Config::set('page_type', $s); HTTP::status((int) $s); self::attach($name, $fallback, $buffer); }
Weapon::add('thumbnail_before', 'do_thumbnail_http_header', 1); Route::accept('t/(:num)/(:all)', function ($size = 0, $path = "") { $path = Filter::colon('thumbnail:path', ASSET . DS . File::path($path)); $G = array('data' => array('path' => $path, 'lot' => func_get_args())); if (!($path = File::exist($path))) { HTTP::status(404); exit; } Weapon::fire('thumbnail_before', array($G, $G)); Image::take($path)->resize($size)->draw(); }, 12); Route::accept('t/(:num)/(:num)/(:all)', function ($width = 0, $height = 0, $path = "") { $path = Filter::colon('thumbnail:path', ASSET . DS . File::path($path)); $G = array('data' => array('path' => $path, 'lot' => func_get_args())); if (!($path = File::exist($path))) { HTTP::status(404); exit; } Weapon::fire('thumbnail_before', array($G, $G)); Image::take($path)->crop($width, $height)->draw(); }, 11); Route::accept('t/(:num)/(:num)/(:num)/(:num)/(:all)', function ($x = 0, $y = 0, $width = 0, $height = 0, $path = "") { $path = Filter::colon('thumbnail:path', ASSET . DS . File::path($path)); $G = array('data' => array('path' => $path, 'lot' => func_get_args())); if (!($path = File::exist($path))) { HTTP::status(404); exit; } Weapon::fire('thumbnail_before', array($G, $G)); Image::take($path)->crop($x, $y, $width, $height)->draw(); }, 10);
protected function error501() { HTTP::status(501); echo "<h1>501 Not Implemented</h1>"; }
/** * ========================================================== * RENDER A 404 PAGE * ========================================================== * * -- CODE: ------------------------------------------------- * * Shield::abort(); * * ---------------------------------------------------------- * * Shield::abort('404-custom'); * * ---------------------------------------------------------- * */ public static function abort($name = '404', $minify = null, $cache = false, $expire = null) { HTTP::status(404); Config::set('page_type', '404'); self::attach($name, $minify, $cache, $expire); }