SYSPATH/classes/Kohana/URL.php [ 107 ]
102 }
103
104 // Validate $host, see if it matches trusted hosts
105 if ( ! static::is_trusted_host($host))
106 {
107 throw new Kohana_Exception(
108 'Untrusted host :host. If you trust :host, add it to the trusted hosts in the `url` config file.',
109 array(':host' => $host)
110 );
111 }
112 }
-
SYSPATH/classes/Kohana/URL.php [ 144 ] » Kohana_URL::base(arguments)
0
bool TRUE
1
bool TRUE
139 // Encode all non-ASCII characters, as per RFC 1738 140 $path = preg_replace_callback('~([^/]+)~', 'URL::_rawurlencode_callback', $path); 141 } 142 143 // Concat the URL 144 return URL::base($protocol, $index).$path; 145 } 146 147 /** 148 * Callback used for encoding all non-ASCII characters, as per RFC 1738 149 * Used by URL::site()
-
SYSPATH/classes/Kohana/HTTP/Exception/Redirect.php [ 29 ] » Kohana_URL::site(arguments)
0
string(10) "home/index"
1
bool TRUE
2
bool TRUE
24 return $this->headers('Location'); 25 26 if (strpos($uri, '://') === FALSE) 27 { 28 // Make the URI into a URL 29 $uri = URL::site($uri, TRUE, ! empty(Kohana::$index_file)); 30 } 31 32 $this->headers('Location', $uri); 33 34 return $this;
-
SYSPATH/classes/Kohana/HTTP.php [ 40 ] » Kohana_HTTP_Exception_Redirect->location(arguments)
0
string(10) "home/index"
35 if ( ! $e instanceof HTTP_Exception_Redirect) 36 throw new Kohana_Exception('Invalid redirect code \':code\'', array( 37 ':code' => $code 38 )); 39 40 throw $e->location($uri); 41 } 42 43 /** 44 * Checks the browser cache to see the response needs to be returned, 45 * execution will halt and a 304 Not Modified will be sent if the
-
SYSPATH/classes/Kohana/Controller.php [ 127 ] » Kohana_HTTP::redirect(arguments)
0
string(10) "home/index"
1
integer 302
122 * @param int $code HTTP Status code to use for the redirect 123 * @throws HTTP_Exception 124 */ 125 public static function redirect($uri = '', $code = 302) 126 { 127 return HTTP::redirect( (string) $uri, $code); 128 } 129 130 /** 131 * Checks the browser cache to see the response needs to be returned, 132 * execution will halt and a 304 Not Modified will be sent if the
-
APPPATH/classes/Controller/Home.php [ 32 ] » Kohana_Controller::redirect(arguments)
0
string(10) "home/index"
27 if($lang != "zh" && $lang !="en"){ 28 $lang = "en"; 29 } 30 Cookie::set('lang', $lang); 31 I18n::lang($lang); 32 $this->redirect("home/index"); 33 34 } 35 36 }
-
SYSPATH/classes/Kohana/Controller.php [ 84 ] » Controller_Home->action_lang()
79 array(':uri' => $this->request->uri()) 80 )->request($this->request); 81 } 82 83 // Execute the action itself 84 $this->{$action}(); 85 86 // Execute the "after action" method 87 $this->after(); 88 89 // Return the response
-
{PHP internal call} » Kohana_Controller->execute()
-
SYSPATH/classes/Kohana/Request/Client/Internal.php [ 97 ] » ReflectionMethod->invoke(arguments)
0
object Controller_Home(2)
{ public request => object Request(19)
{ protected _requested_with => NULL protected _method => string(3) "GET" protected _protocol => string(8) "HTTP/1.1" protected _secure => bool FALSE protected _referrer => NULL protected _route => object Route(5)
public response => object Response(5){ protected _filters => array(0) protected _uri => string(32) "(<controller>(/<action>(/<id>)))" protected _regex => array(0) protected _defaults => array(2) ( "controller" => string(4) "Home" "action" => string(5) "index" ) protected _route_regex => string(95) "#^(?:(?P<controller>[^/.,;?\n]++)(?:/(?P<action>[^/.,;?\n]++)(?:/(?P<id>[^/.,;?\n]++))?)?)?$#uD" }
protected _routes => array(0) protected _header => object HTTP_Header(0){ }
protected _body => NULL protected _directory => string(0) "" protected _controller => string(4) "Home" protected _action => string(4) "lang" protected _uri => string(12) "home/lang/zh" protected _external => bool FALSE protected _params => array(1) ( "id" => string(2) "zh" ) protected _get => array(0) protected _post => array(0) protected _cookies => array(0) protected _client => object Request_Client_Internal(9){ protected _previous_environment => NULL protected _cache => NULL protected _follow => bool FALSE protected _follow_headers => array(1) ( 0 => string(13) "authorization" ) protected _strict_redirect => bool TRUE protected _header_callbacks => array(1) ( "Location" => string(34) "Request_Client::on_header_location" ) protected _max_callback_depth => integer 5 protected _callback_depth => integer 1 protected _callback_params => array(0) }
}{ protected _status => integer 200 protected _header => object HTTP_Header(0)
}{ }
protected _body => string(0) "" protected _cookies => array(0) protected _protocol => string(8) "HTTP/1.1" }92 93 // Create a new instance of the controller 94 $controller = $class->newInstance($request, $response); 95 96 // Run the controller's execute() method 97 $response = $class->getMethod('execute')->invoke($controller); 98 99 if ( ! $response instanceof Response) 100 { 101 // Controller failed to return a Response. 102 throw new Kohana_Exception('Controller failed to return a Response');
-
SYSPATH/classes/Kohana/Request/Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request(arguments)
0
object Request(19)
{ protected _requested_with => NULL protected _method => string(3) "GET" protected _protocol => string(8) "HTTP/1.1" protected _secure => bool FALSE protected _referrer => NULL protected _route => object Route(5)
{ protected _filters => array(0) protected _uri => string(32) "(<controller>(/<action>(/<id>)))" protected _regex => array(0) protected _defaults => array(2) ( "controller" => string(4) "Home" "action" => string(5) "index" ) protected _route_regex => string(95) "#^(?:(?P<controller>[^/.,;?\n]++)(?:/(?P<action>[^/.,;?\n]++)(?:/(?P<id>[^/.,;?\n]++))?)?)?$#uD" }
protected _routes => array(0) protected _header => object HTTP_Header(0){ }
protected _body => NULL protected _directory => string(0) "" protected _controller => string(4) "Home" protected _action => string(4) "lang" protected _uri => string(12) "home/lang/zh" protected _external => bool FALSE protected _params => array(1) ( "id" => string(2) "zh" ) protected _get => array(0) protected _post => array(0) protected _cookies => array(0) protected _client => object Request_Client_Internal(9){ protected _previous_environment => NULL protected _cache => NULL protected _follow => bool FALSE protected _follow_headers => array(1) ( 0 => string(13) "authorization" ) protected _strict_redirect => bool TRUE protected _header_callbacks => array(1) ( "Location" => string(34) "Request_Client::on_header_location" ) protected _max_callback_depth => integer 5 protected _callback_depth => integer 1 protected _callback_params => array(0) }
}1
object Response(5)
{ protected _status => integer 200 protected _header => object HTTP_Header(0)
{ }
protected _body => string(0) "" protected _cookies => array(0) protected _protocol => string(8) "HTTP/1.1" }109 $orig_response = $response = Response::factory(array('_protocol' => $request->protocol())); 110 111 if (($cache = $this->cache()) instanceof HTTP_Cache) 112 return $cache->execute($this, $request, $response); 113 114 $response = $this->execute_request($request, $response); 115 116 // Execute response callbacks 117 foreach ($this->header_callbacks() as $header => $callback) 118 { 119 if ($response->headers($header))
-
SYSPATH/classes/Kohana/Request.php [ 993 ] » Kohana_Request_Client->execute(arguments)
0
object Request(19)
{ protected _requested_with => NULL protected _method => string(3) "GET" protected _protocol => string(8) "HTTP/1.1" protected _secure => bool FALSE protected _referrer => NULL protected _route => object Route(5)
{ protected _filters => array(0) protected _uri => string(32) "(<controller>(/<action>(/<id>)))" protected _regex => array(0) protected _defaults => array(2) ( "controller" => string(4) "Home" "action" => string(5) "index" ) protected _route_regex => string(95) "#^(?:(?P<controller>[^/.,;?\n]++)(?:/(?P<action>[^/.,;?\n]++)(?:/(?P<id>[^/.,;?\n]++))?)?)?$#uD" }
protected _routes => array(0) protected _header => object HTTP_Header(0){ }
protected _body => NULL protected _directory => string(0) "" protected _controller => string(4) "Home" protected _action => string(4) "lang" protected _uri => string(12) "home/lang/zh" protected _external => bool FALSE protected _params => array(1) ( "id" => string(2) "zh" ) protected _get => array(0) protected _post => array(0) protected _cookies => array(0) protected _client => object Request_Client_Internal(9){ protected _previous_environment => NULL protected _cache => NULL protected _follow => bool FALSE protected _follow_headers => array(1) ( 0 => string(13) "authorization" ) protected _strict_redirect => bool TRUE protected _header_callbacks => array(1) ( "Location" => string(34) "Request_Client::on_header_location" ) protected _max_callback_depth => integer 5 protected _callback_depth => integer 1 protected _callback_params => array(0) }
}988 throw new Request_Exception('Unable to execute :uri without a Kohana_Request_Client', array( 989 ':uri' => $this->_uri, 990 )); 991 } 992 993 return $this->_client->execute($this); 994 } 995 996 /** 997 * Returns whether this request is the initial request Kohana received. 998 * Can be used to test for sub requests.
-
DOCROOT/index.php [ 118 ] » Kohana_Request->execute()
113 /** 114 * Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO']. 115 * If no source is specified, the URI will be automatically detected. 116 */ 117 echo Request::factory(TRUE, array(), FALSE) 118 ->execute() 119 ->send_headers(TRUE) 120 ->body(); 121 }