Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

clean up the error tutorial (refs #3769)

  • Loading branch information...
commit a73ea67e1cbdb69ad8adce8cb45cf1d520813bc7 1 parent 3120e8b
Lorenzo Pisani authored June 05, 2012

Showing 1 changed file with 9 additions and 9 deletions. Show diff stats Hide diff stats

  1. 18  guide/kohana/tutorials/error-pages.md
18  guide/kohana/tutorials/error-pages.md
Source Rendered
@@ -16,7 +16,7 @@ Our custom exception handler is self explanatory.
16 16
 
17 17
 		public static function handler(Exception $e)
18 18
 		{
19  
-			if (Kohana::DEVELOPMENT === Kohana::$environment)
  19
+			if (Kohana::$environment === Kohana::DEVELOPMENT)
20 20
 			{
21 21
 				parent::handler($e);
22 22
 			}
@@ -26,7 +26,7 @@ Our custom exception handler is self explanatory.
26 26
 				{
27 27
 					Kohana::$log->add(Log::ERROR, parent::text($e));
28 28
 
29  
-					$attributes = array
  29
+					$params = array
30 30
 					(
31 31
 						'action'  => 500,
32 32
 						'message' => rawurlencode($e->getMessage())
@@ -34,14 +34,14 @@ Our custom exception handler is self explanatory.
34 34
 
35 35
 					if ($e instanceof HTTP_Exception)
36 36
 					{
37  
-						$attributes['action'] = $e->getCode();
  37
+						$params['action'] = $e->getCode();
38 38
 					}
39 39
 
40 40
 					// Error sub-request.
41  
-					echo Request::factory(Route::get('error')->uri($attributes))
42  
-					->execute()
43  
-					->send_headers()
44  
-					->body();
  41
+					echo Request::factory(Route::get('error')->uri($params))
  42
+						->execute()
  43
+						->send_headers()
  44
+						->body();
45 45
 				}
46 46
 				catch (Exception $e)
47 47
 				{
@@ -92,10 +92,10 @@ would display an error 500 page.
92 92
 	{
93 93
 		parent::before();
94 94
 
95  
-		$this->template->page = URL::site(rawurldecode(Request::$initial->uri()));
  95
+		$this->template->page = URL::site(rawurldecode(Request::initial()->uri()));
96 96
 
97 97
 		// Internal request only!
98  
-		if (Request::$initial !== Request::$current)
  98
+		if ( ! Request::current()->is_initial())
99 99
 		{
100 100
 			if ($message = rawurldecode($this->request->param('message')))
101 101
 			{

0 notes on commit a73ea67

Please sign in to comment.
Something went wrong with that request. Please try again.