Kohana v3.3.2
This commit is contained in:
@@ -4,7 +4,7 @@ abstract class Kohana_HTTP_Exception extends Kohana_Exception {
|
||||
|
||||
/**
|
||||
* Creates an HTTP_Exception of the specified type.
|
||||
*
|
||||
*
|
||||
* @param integer $code the http status code
|
||||
* @param string $message status message, custom content to display with error
|
||||
* @param array $variables translation variables
|
||||
@@ -13,7 +13,7 @@ abstract class Kohana_HTTP_Exception extends Kohana_Exception {
|
||||
public static function factory($code, $message = NULL, array $variables = NULL, Exception $previous = NULL)
|
||||
{
|
||||
$class = 'HTTP_Exception_'.$code;
|
||||
|
||||
|
||||
return new $class($message, $variables, $previous);
|
||||
}
|
||||
|
||||
@@ -44,15 +44,15 @@ abstract class Kohana_HTTP_Exception extends Kohana_Exception {
|
||||
|
||||
/**
|
||||
* Store the Request that triggered this exception.
|
||||
*
|
||||
*
|
||||
* @param Request $request Request object that triggered this exception.
|
||||
* @return Response
|
||||
* @return HTTP_Exception
|
||||
*/
|
||||
public function request(Request $request = NULL)
|
||||
{
|
||||
if ($request === NULL)
|
||||
return $this->_request;
|
||||
|
||||
|
||||
$this->_request = $request;
|
||||
|
||||
return $this;
|
||||
@@ -60,7 +60,7 @@ abstract class Kohana_HTTP_Exception extends Kohana_Exception {
|
||||
|
||||
/**
|
||||
* Generate a Response for the current Exception
|
||||
*
|
||||
*
|
||||
* @uses Kohana_Exception::response()
|
||||
* @return Response
|
||||
*/
|
||||
@@ -69,4 +69,4 @@ abstract class Kohana_HTTP_Exception extends Kohana_Exception {
|
||||
return Kohana_Exception::response($this);
|
||||
}
|
||||
|
||||
} // End Kohana_HTTP_Exception
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_300 extends HTTP_Exception_Redirect {
|
||||
*/
|
||||
protected $_code = 300;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_301 extends HTTP_Exception_Redirect {
|
||||
*/
|
||||
protected $_code = 301;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_302 extends HTTP_Exception_Redirect {
|
||||
*/
|
||||
protected $_code = 302;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_303 extends HTTP_Exception_Redirect {
|
||||
*/
|
||||
protected $_code = 303;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -6,5 +6,5 @@ class Kohana_HTTP_Exception_304 extends HTTP_Exception_Expected {
|
||||
* @var integer HTTP 304 Not Modified
|
||||
*/
|
||||
protected $_code = 304;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ class Kohana_HTTP_Exception_305 extends HTTP_Exception_Expected {
|
||||
|
||||
/**
|
||||
* Specifies the proxy to replay this request via
|
||||
*
|
||||
*
|
||||
* @param string $location URI of the proxy
|
||||
*/
|
||||
public function location($uri = NULL)
|
||||
@@ -24,7 +24,7 @@ class Kohana_HTTP_Exception_305 extends HTTP_Exception_Expected {
|
||||
|
||||
/**
|
||||
* Validate this exception contains everything needed to continue.
|
||||
*
|
||||
*
|
||||
* @throws Kohana_Exception
|
||||
* @return bool
|
||||
*/
|
||||
@@ -38,4 +38,5 @@ class Kohana_HTTP_Exception_305 extends HTTP_Exception_Expected {
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_307 extends HTTP_Exception_Redirect {
|
||||
*/
|
||||
protected $_code = 307;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_400 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 400;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -9,14 +9,14 @@ class Kohana_HTTP_Exception_401 extends HTTP_Exception_Expected {
|
||||
|
||||
/**
|
||||
* Specifies the WWW-Authenticate challenge.
|
||||
*
|
||||
*
|
||||
* @param string $challenge WWW-Authenticate challenge (eg `Basic realm="Control Panel"`)
|
||||
*/
|
||||
public function authenticate($challenge = NULL)
|
||||
{
|
||||
if ($challenge === NULL)
|
||||
return $this->headers('www-authenticate');
|
||||
|
||||
|
||||
$this->headers('www-authenticate', $challenge);
|
||||
|
||||
return $this;
|
||||
@@ -24,7 +24,7 @@ class Kohana_HTTP_Exception_401 extends HTTP_Exception_Expected {
|
||||
|
||||
/**
|
||||
* Validate this exception contains everything needed to continue.
|
||||
*
|
||||
*
|
||||
* @throws Kohana_Exception
|
||||
* @return bool
|
||||
*/
|
||||
@@ -35,4 +35,5 @@ class Kohana_HTTP_Exception_401 extends HTTP_Exception_Expected {
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_402 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 402;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_403 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 403;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_404 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 404;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ class Kohana_HTTP_Exception_405 extends HTTP_Exception_Expected {
|
||||
|
||||
/**
|
||||
* Specifies the list of allowed HTTP methods
|
||||
*
|
||||
*
|
||||
* @param array $methods List of allowed methods
|
||||
*/
|
||||
public function allowed($methods)
|
||||
@@ -26,7 +26,7 @@ class Kohana_HTTP_Exception_405 extends HTTP_Exception_Expected {
|
||||
|
||||
/**
|
||||
* Validate this exception contains everything needed to continue.
|
||||
*
|
||||
*
|
||||
* @throws Kohana_Exception
|
||||
* @return bool
|
||||
*/
|
||||
@@ -38,4 +38,4 @@ class Kohana_HTTP_Exception_405 extends HTTP_Exception_Expected {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_406 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 406;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_407 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 407;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_408 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 408;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_409 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 409;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_410 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 410;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_411 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 411;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_412 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 412;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_413 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 413;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_414 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 414;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_415 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 415;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_416 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 416;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_417 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 417;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_500 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 500;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_501 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 501;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_502 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 502;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_503 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 503;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_504 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 504;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_505 extends HTTP_Exception {
|
||||
*/
|
||||
protected $_code = 505;
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?php defined('SYSPATH') OR die('No direct script access.');
|
||||
/**
|
||||
* "Expected" HTTP exception class. Used for all [HTTP_Exception]'s where a standard
|
||||
* Kohana error page should never be shown.
|
||||
*
|
||||
* Kohana error page should never be shown.
|
||||
*
|
||||
* Eg [HTTP_Exception_301], [HTTP_Exception_302] etc
|
||||
*
|
||||
* @package Kohana
|
||||
@@ -39,7 +39,7 @@ abstract class Kohana_HTTP_Exception_Expected extends HTTP_Exception {
|
||||
|
||||
/**
|
||||
* Gets and sets headers to the [Response].
|
||||
*
|
||||
*
|
||||
* @see [Response::headers]
|
||||
* @param mixed $key
|
||||
* @param string $value
|
||||
@@ -57,7 +57,7 @@ abstract class Kohana_HTTP_Exception_Expected extends HTTP_Exception {
|
||||
|
||||
/**
|
||||
* Validate this exception contains everything needed to continue.
|
||||
*
|
||||
*
|
||||
* @throws Kohana_Exception
|
||||
* @return bool
|
||||
*/
|
||||
@@ -68,7 +68,7 @@ abstract class Kohana_HTTP_Exception_Expected extends HTTP_Exception {
|
||||
|
||||
/**
|
||||
* Generate a Response for the current Exception
|
||||
*
|
||||
*
|
||||
* @uses Kohana_Exception::response()
|
||||
* @return Response
|
||||
*/
|
||||
@@ -79,4 +79,4 @@ abstract class Kohana_HTTP_Exception_Expected extends HTTP_Exception {
|
||||
return $this->_response;
|
||||
}
|
||||
|
||||
} // End Kohana_HTTP_Exception
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Redirect HTTP exception class. Used for all [HTTP_Exception]'s where the status
|
||||
* code indicates a redirect.
|
||||
*
|
||||
*
|
||||
* Eg [HTTP_Exception_301], [HTTP_Exception_302] and most of the other 30x's
|
||||
*
|
||||
* @package Kohana
|
||||
@@ -15,14 +15,14 @@ abstract class Kohana_HTTP_Exception_Redirect extends HTTP_Exception_Expected {
|
||||
|
||||
/**
|
||||
* Specifies the URI to redirect to.
|
||||
*
|
||||
*
|
||||
* @param string $location URI of the proxy
|
||||
*/
|
||||
public function location($uri = NULL)
|
||||
{
|
||||
if ($uri === NULL)
|
||||
return $this->headers('Location');
|
||||
|
||||
|
||||
if (strpos($uri, '://') === FALSE)
|
||||
{
|
||||
// Make the URI into a URL
|
||||
@@ -36,7 +36,7 @@ abstract class Kohana_HTTP_Exception_Redirect extends HTTP_Exception_Expected {
|
||||
|
||||
/**
|
||||
* Validate this exception contains everything needed to continue.
|
||||
*
|
||||
*
|
||||
* @throws Kohana_Exception
|
||||
* @return bool
|
||||
*/
|
||||
@@ -48,4 +48,4 @@ abstract class Kohana_HTTP_Exception_Redirect extends HTTP_Exception_Expected {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
} // End Kohana_HTTP_Exception_Redirect
|
||||
}
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* @category HTTP
|
||||
* @author Kohana Team
|
||||
* @since 3.1.0
|
||||
* @copyright (c) 2008-2012 Kohana Team
|
||||
* @license http://kohanaphp.com/license
|
||||
* @copyright (c) 2008-2014 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
*/
|
||||
class Kohana_HTTP_Header extends ArrayObject {
|
||||
|
||||
@@ -287,7 +287,7 @@ class Kohana_HTTP_Header extends ArrayObject {
|
||||
* @param int $flags Flags
|
||||
* @param string $iterator_class The iterator class to use
|
||||
*/
|
||||
public function __construct(array $input = array(), $flags = NULL, $iterator_class = 'ArrayIterator')
|
||||
public function __construct(array $input = array(), $flags = 0, $iterator_class = 'ArrayIterator')
|
||||
{
|
||||
/**
|
||||
* @link http://www.w3.org/Protocols/rfc2616/rfc2616.html
|
||||
@@ -859,12 +859,6 @@ class Kohana_HTTP_Header extends ArrayObject {
|
||||
*/
|
||||
public function send_headers(HTTP_Response $response = NULL, $replace = FALSE, $callback = NULL)
|
||||
{
|
||||
if ($response === NULL)
|
||||
{
|
||||
// Default to the initial request message
|
||||
$response = Request::initial()->response();
|
||||
}
|
||||
|
||||
$protocol = $response->protocol();
|
||||
$status = $response->status();
|
||||
|
||||
@@ -946,4 +940,4 @@ class Kohana_HTTP_Header extends ArrayObject {
|
||||
return $this;
|
||||
}
|
||||
|
||||
} // End Kohana_HTTP_Header
|
||||
}
|
||||
|
@@ -7,8 +7,8 @@
|
||||
* @category HTTP
|
||||
* @author Kohana Team
|
||||
* @since 3.1.0
|
||||
* @copyright (c) 2008-2012 Kohana Team
|
||||
* @license http://kohanaphp.com/license
|
||||
* @copyright (c) 2008-2014 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
*/
|
||||
interface Kohana_HTTP_Message {
|
||||
|
||||
@@ -53,4 +53,5 @@ interface Kohana_HTTP_Message {
|
||||
* @return string
|
||||
*/
|
||||
public function render();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -8,8 +8,8 @@
|
||||
* @category HTTP
|
||||
* @author Kohana Team
|
||||
* @since 3.1.0
|
||||
* @copyright (c) 2008-2012 Kohana Team
|
||||
* @license http://kohanaphp.com/license
|
||||
* @copyright (c) 2008-2014 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
*/
|
||||
interface Kohana_HTTP_Request extends HTTP_Message {
|
||||
|
||||
@@ -61,4 +61,4 @@ interface Kohana_HTTP_Request extends HTTP_Message {
|
||||
*/
|
||||
public function post($key = NULL, $value = NULL);
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?php defined('SYSPATH') OR die('No direct script access.');
|
||||
/**
|
||||
* A HTTP Reponse specific interface that adds the methods required
|
||||
* A HTTP Response specific interface that adds the methods required
|
||||
* by HTTP responses. Over and above [Kohana_HTTP_Interaction], this
|
||||
* interface provides status.
|
||||
*
|
||||
@@ -8,8 +8,8 @@
|
||||
* @category HTTP
|
||||
* @author Kohana Team
|
||||
* @since 3.1.0
|
||||
* @copyright (c) 2008-2012 Kohana Team
|
||||
* @license http://kohanaphp.com/license
|
||||
* @copyright (c) 2008-2014 Kohana Team
|
||||
* @license http://kohanaframework.org/license
|
||||
*/
|
||||
interface Kohana_HTTP_Response extends HTTP_Message {
|
||||
|
||||
@@ -28,4 +28,4 @@ interface Kohana_HTTP_Response extends HTTP_Message {
|
||||
*/
|
||||
public function status($code = NULL);
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user