Kohana::show_404() -> throw new Kohana_404_Exception()

This commit is contained in:
Bharat Mediratta 2009-11-25 13:49:40 -08:00
parent 33b1d4b7ef
commit 4a417708f0
6 changed files with 9 additions and 9 deletions

View File

@ -61,7 +61,7 @@ class Digibug_Controller extends Controller {
if ($type == "full") {
$remote_addr = ip2long($this->input->server("REMOTE_ADDR"));
if ($remote_addr === false) {
Kohana::show_404();
throw new Kohana_404_Exception();
}
$config = Kohana::config("digibug");
@ -76,13 +76,13 @@ class Digibug_Controller extends Controller {
}
}
if (!$authorized) {
Kohana::show_404();
throw new Kohana_404_Exception();
}
}
$proxy = ORM::factory("digibug_proxy", array("uuid" => $id));
if (!$proxy->loaded() || !$proxy->item->loaded()) {
Kohana::show_404();
throw new Kohana_404_Exception();
}
$file = $type == "full" ? $proxy->item->file_path() : $proxy->item->thumb_path();

View File

@ -56,7 +56,7 @@ class Combined_Controller extends Controller {
}
if (empty($key)) {
Kohana::show_404();
throw new Kohana_404_Exception();
}
$cache = Cache::instance();
@ -71,7 +71,7 @@ class Combined_Controller extends Controller {
$content = $cache->get($key);
}
if (empty($content)) {
Kohana::show_404();
throw new Kohana_404_Exception();
}
// $type is either 'javascript' or 'css'

View File

@ -21,7 +21,7 @@ class Items_Controller extends Controller {
public function __call($function, $args) {
$item = ORM::factory("item", (int)$function);
if (!$item->loaded()) {
return Kohana::show_404();
throw new Kohana_404_Exception();
}
// Redirect to the more specific resource type, since it will render
// differently. We could also just delegate here, but it feels more appropriate

View File

@ -20,7 +20,7 @@
class Gallery_Unit_Test_Controller extends Controller {
function Index() {
if (!TEST_MODE) {
print Kohana::show_404();
print throw new Kohana_404_Exception();
}
// Jump through some hoops to satisfy the way that we check for the site_domain in

View File

@ -39,7 +39,7 @@ class Rss_Controller extends Controller {
}
}
if (empty($feed)) {
Kohana::show_404();
throw new Kohana_404_Exception();
}
if ($feed->max_pages && $page > $feed->max_pages) {

View File

@ -32,7 +32,7 @@ class tag_rss_Core {
if ($feed_id == "tag") {
$tag = ORM::factory("tag", $id);
if (!$tag->loaded()) {
Kohana::show_404();
throw new Kohana_404_Exception();
}
$feed->children = $tag->items($limit, $offset, "photo");
$feed->max_pages = ceil($tag->count / $limit);