Kohana v3.3.2

This commit is contained in:
Deon George
2014-09-06 23:43:07 +10:00
parent f96694b18f
commit 8888719653
236 changed files with 1685 additions and 996 deletions

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class Arr extends Kohana_Arr {}
class Arr extends Kohana_Arr {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class Config extends Kohana_Config {}
class Config extends Kohana_Config {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class Config_File extends Kohana_Config_File {}
class Config_File extends Kohana_Config_File {}

View File

@@ -1,4 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class Config_Group extends Kohana_Config_Group {}
class Config_Group extends Kohana_Config_Group {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class File extends Kohana_File {}
class File extends Kohana_File {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTML extends Kohana_HTML {}
class HTML extends Kohana_HTML {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
abstract class HTTP extends Kohana_HTTP {}
abstract class HTTP extends Kohana_HTTP {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception extends Kohana_HTTP_Exception {}
class HTTP_Exception extends Kohana_HTTP_Exception {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_300 extends Kohana_HTTP_Exception_300 {}
class HTTP_Exception_300 extends Kohana_HTTP_Exception_300 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_301 extends Kohana_HTTP_Exception_301 {}
class HTTP_Exception_301 extends Kohana_HTTP_Exception_301 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_302 extends Kohana_HTTP_Exception_302 {}
class HTTP_Exception_302 extends Kohana_HTTP_Exception_302 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_303 extends Kohana_HTTP_Exception_303 {}
class HTTP_Exception_303 extends Kohana_HTTP_Exception_303 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_304 extends Kohana_HTTP_Exception_304 {}
class HTTP_Exception_304 extends Kohana_HTTP_Exception_304 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_305 extends Kohana_HTTP_Exception_305 {}
class HTTP_Exception_305 extends Kohana_HTTP_Exception_305 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_307 extends Kohana_HTTP_Exception_307 {}
class HTTP_Exception_307 extends Kohana_HTTP_Exception_307 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_400 extends Kohana_HTTP_Exception_400 {}
class HTTP_Exception_400 extends Kohana_HTTP_Exception_400 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_401 extends Kohana_HTTP_Exception_401 {}
class HTTP_Exception_401 extends Kohana_HTTP_Exception_401 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_402 extends Kohana_HTTP_Exception_402 {}
class HTTP_Exception_402 extends Kohana_HTTP_Exception_402 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_403 extends Kohana_HTTP_Exception_403 {}
class HTTP_Exception_403 extends Kohana_HTTP_Exception_403 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {}
class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_405 extends Kohana_HTTP_Exception_405 {}
class HTTP_Exception_405 extends Kohana_HTTP_Exception_405 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_406 extends Kohana_HTTP_Exception_406 {}
class HTTP_Exception_406 extends Kohana_HTTP_Exception_406 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_407 extends Kohana_HTTP_Exception_407 {}
class HTTP_Exception_407 extends Kohana_HTTP_Exception_407 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_408 extends Kohana_HTTP_Exception_408 {}
class HTTP_Exception_408 extends Kohana_HTTP_Exception_408 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_409 extends Kohana_HTTP_Exception_409 {}
class HTTP_Exception_409 extends Kohana_HTTP_Exception_409 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_410 extends Kohana_HTTP_Exception_410 {}
class HTTP_Exception_410 extends Kohana_HTTP_Exception_410 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_411 extends Kohana_HTTP_Exception_411 {}
class HTTP_Exception_411 extends Kohana_HTTP_Exception_411 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_412 extends Kohana_HTTP_Exception_412 {}
class HTTP_Exception_412 extends Kohana_HTTP_Exception_412 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_413 extends Kohana_HTTP_Exception_413 {}
class HTTP_Exception_413 extends Kohana_HTTP_Exception_413 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_414 extends Kohana_HTTP_Exception_414 {}
class HTTP_Exception_414 extends Kohana_HTTP_Exception_414 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_415 extends Kohana_HTTP_Exception_415 {}
class HTTP_Exception_415 extends Kohana_HTTP_Exception_415 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_416 extends Kohana_HTTP_Exception_416 {}
class HTTP_Exception_416 extends Kohana_HTTP_Exception_416 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_417 extends Kohana_HTTP_Exception_417 {}
class HTTP_Exception_417 extends Kohana_HTTP_Exception_417 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_500 extends Kohana_HTTP_Exception_500 {}
class HTTP_Exception_500 extends Kohana_HTTP_Exception_500 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_501 extends Kohana_HTTP_Exception_501 {}
class HTTP_Exception_501 extends Kohana_HTTP_Exception_501 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_502 extends Kohana_HTTP_Exception_502 {}
class HTTP_Exception_502 extends Kohana_HTTP_Exception_502 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_503 extends Kohana_HTTP_Exception_503 {}
class HTTP_Exception_503 extends Kohana_HTTP_Exception_503 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_504 extends Kohana_HTTP_Exception_504 {}
class HTTP_Exception_504 extends Kohana_HTTP_Exception_504 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Exception_505 extends Kohana_HTTP_Exception_505 {}
class HTTP_Exception_505 extends Kohana_HTTP_Exception_505 {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
abstract class HTTP_Exception_Expected extends Kohana_HTTP_Exception_Expected {}
abstract class HTTP_Exception_Expected extends Kohana_HTTP_Exception_Expected {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
abstract class HTTP_Exception_Redirect extends Kohana_HTTP_Exception_Redirect {}
abstract class HTTP_Exception_Redirect extends Kohana_HTTP_Exception_Redirect {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class HTTP_Header extends Kohana_HTTP_Header {}
class HTTP_Header extends Kohana_HTTP_Header {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
interface HTTP_Message extends Kohana_HTTP_Message {}
interface HTTP_Message extends Kohana_HTTP_Message {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
interface HTTP_Request extends Kohana_HTTP_Request {}
interface HTTP_Request extends Kohana_HTTP_Request {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
interface HTTP_Response extends Kohana_HTTP_Response {}
interface HTTP_Response extends Kohana_HTTP_Response {}

View File

@@ -1,3 +1,3 @@
<?php defined('SYSPATH') OR die('No direct script access.');
class Inflector extends Kohana_Inflector {}
class Inflector extends Kohana_Inflector {}

View File

@@ -207,8 +207,13 @@ class Kohana_Arr {
$delimiter = Arr::$delimiter;
}
// Split the keys by delimiter
$keys = explode($delimiter, $path);
// The path has already been separated into keys
$keys = $path;
if ( ! is_array($path))
{
// Split the keys by delimiter
$keys = explode($delimiter, $path);
}
// Set current $array to inner-most array path
while (count($keys) > 1)
@@ -283,7 +288,7 @@ class Kohana_Arr {
*
* // Get the values "username", "password" from $_POST
* $auth = Arr::extract($_POST, array('username', 'password'));
*
*
* // Get the value "level1.level2a" from $data
* $data = array('level1' => array('level2a' => 'value 1', 'level2b' => 'value 2'));
* Arr::extract($data, array('level1.level2a', 'password'));
@@ -617,4 +622,4 @@ class Kohana_Arr {
return $flat;
}
} // End arr
}

View File

@@ -3,7 +3,7 @@
* Wrapper for configuration arrays. Multiple configuration readers can be
* attached to allow loading configuration from files, database, etc.
*
* Configuration directives cascade across config sources in the same way that
* Configuration directives cascade across config sources in the same way that
* files cascade across the filesystem.
*
* Directives from sources high in the sources list will override ones from those
@@ -74,9 +74,9 @@ class Kohana_Config {
}
/**
* Load a configuration group. Searches all the config sources, merging all the
* directives found into a single config group. Any changes made to the config
* in this group will be mirrored across all writable sources.
* Load a configuration group. Searches all the config sources, merging all the
* directives found into a single config group. Any changes made to the config
* in this group will be mirrored across all writable sources.
*
* $array = $config->load($name);
*
@@ -146,7 +146,7 @@ class Kohana_Config {
/**
* Copy one configuration group to all of the other writers.
*
*
* $config->copy($name);
*
* @param string $group configuration group name
@@ -181,7 +181,7 @@ class Kohana_Config {
{
continue;
}
// Copy each value in the config
$source->write($group, $key, $value);
}
@@ -189,4 +189,4 @@ class Kohana_Config {
return $this;
}
} // End Kohana_Config
}

View File

@@ -9,7 +9,7 @@
* @copyright (c) 2009-2012 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Config_File extends Kohana_Config_File_Reader
class Kohana_Config_File extends Kohana_Config_File_Reader
{
// @see Kohana_Config_File_Reader
}

View File

@@ -1,4 +1,4 @@
<?php
<?php defined('SYSPATH') OR die('No direct script access.');
/**
* File-based configuration reader. Multiple configuration directories can be
* used by attaching multiple instances of this class to [Kohana_Config].
@@ -53,4 +53,4 @@ class Kohana_Config_File_Reader implements Kohana_Config_Reader {
return $config;
}
} // End Kohana_Config
}

View File

@@ -4,15 +4,15 @@
* The group wrapper acts as an interface to all the config directives
* gathered from across the system.
*
* This is the object returned from Kohana_Config::load
* This is the object returned from Kohana_Config::load
*
* Any modifications to configuration items should be done through an instance of this object
*
* @package Kohana
* @category Configuration
* @author Kohana Team
* @copyright (c) 2012 Kohana Team
* @license http://kohanaphp.com/license
* @copyright (c) 2012-2014 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Config_Group extends ArrayObject {
@@ -31,7 +31,7 @@ class Kohana_Config_Group extends ArrayObject {
protected $_group_name = '';
/**
* Constructs the group object. Kohana_Config passes the config group
* Constructs the group object. Kohana_Config passes the config group
* and its config items to the object here.
*
* @param Kohana_Config $instance "Owning" instance of Kohana_Config
@@ -77,7 +77,7 @@ class Kohana_Config_Group extends ArrayObject {
{
return $this->_group_name;
}
/**
* Get a variable from the configuration or return the default value.
*
@@ -110,7 +110,7 @@ class Kohana_Config_Group extends ArrayObject {
/**
* Overrides ArrayObject::offsetSet()
* This method is called when config is changed via
* This method is called when config is changed via
*
* $config->var = 'asd';
*
@@ -127,4 +127,5 @@ class Kohana_Config_Group extends ArrayObject {
return parent::offsetSet($key, $value);
}
}

View File

@@ -11,9 +11,9 @@
*/
interface Kohana_Config_Reader extends Kohana_Config_Source
{
/**
* Tries to load the specificed configuration group
* Tries to load the specified configuration group
*
* Returns FALSE if group does not exist or an array if it does
*
@@ -21,5 +21,5 @@ interface Kohana_Config_Reader extends Kohana_Config_Source
* @return boolean|array
*/
public function load($group);
}

View File

@@ -7,8 +7,8 @@
* @package Kohana
* @category Configuration
* @author Kohana Team
* @copyright (c) 2012 Kohana Team
* @license http://kohanaphp.com/license
* @copyright (c) 2012-2014 Kohana Team
* @license http://kohanaframework.org/license
*/
interface Kohana_Config_Source {}

View File

@@ -3,19 +3,19 @@
/**
* Interface for config writers
*
* Specifies the methods that a config writer must implement
*
* Specifies the methods that a config writer must implement
*
* @package Kohana
* @author Kohana Team
* @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaphp.com/license
* @copyright (c) 2008-2014 Kohana Team
* @license http://kohanaframework.org/license
*/
interface Kohana_Config_Writer extends Kohana_Config_Source
{
/**
* Writes the passed config for $group
*
* Returns chainable instance on success or throws
* Returns chainable instance on success or throws
* Kohana_Config_Exception on failure
*
* @param string $group The config group
@@ -24,4 +24,5 @@ interface Kohana_Config_Writer extends Kohana_Config_Source
* @return boolean
*/
public function write($group, $key, $config);
}

View File

@@ -51,15 +51,15 @@ abstract class Kohana_Controller {
/**
* Executes the given action and calls the [Controller::before] and [Controller::after] methods.
*
*
* Can also be used to catch exceptions from actions in a single place.
*
*
* 1. Before the controller action is called, the [Controller::before] method
* will be called.
* 2. Next the controller action will be called.
* 3. After the controller action is called, the [Controller::after] method
* will be called.
*
*
* @throws HTTP_Exception_404
* @return Response
*/
@@ -105,7 +105,7 @@ abstract class Kohana_Controller {
* Automatically executed after the controller action. Can be used to apply
* transformation to the response, add extra output, and execute
* other custom code.
*
*
* @return void
*/
public function after()
@@ -124,16 +124,16 @@ abstract class Kohana_Controller {
*/
public static function redirect($uri = '', $code = 302)
{
return HTTP::redirect($uri, $code);
return HTTP::redirect( (string) $uri, $code);
}
/**
* Checks the browser cache to see the response needs to be returned,
* execution will halt and a 304 Not Modified will be sent if the
* browser cache is up to date.
*
*
* $this->check_cache(sha1($content));
*
*
* @param string $etag Resource Etag
* @return Response
*/
@@ -142,4 +142,4 @@ abstract class Kohana_Controller {
return HTTP::check_cache($this->request, $this->response, $etag);
}
} // End Controller
}

View File

@@ -47,4 +47,4 @@ abstract class Kohana_Controller_Template extends Controller {
parent::after();
}
} // End Controller_Template
}

View File

@@ -124,7 +124,6 @@ class Kohana_Cookie {
*
* @param string $name cookie name
* @return boolean
* @uses Cookie::set
*/
public static function delete($name)
{
@@ -149,7 +148,7 @@ class Kohana_Cookie {
// Require a valid salt
if ( ! Cookie::$salt)
{
throw new Kohana_Exception('A valid cookie salt is required. Please set Cookie::$salt.');
throw new Kohana_Exception('A valid cookie salt is required. Please set Cookie::$salt in your bootstrap.php. For more information check the documentation');
}
// Determine the user agent
@@ -158,4 +157,4 @@ class Kohana_Cookie {
return sha1($agent.$name.$value.Cookie::$salt);
}
} // End cookie
}

View File

@@ -16,8 +16,8 @@
class Kohana_Core {
// Release version and codename
const VERSION = '3.3.0';
const CODENAME = 'badius';
const VERSION = '3.3.1';
const CODENAME = 'peregrinus';
// Common environment type constants for consistency and convenience
const PRODUCTION = 10;
@@ -383,7 +383,7 @@ class Kohana_Core {
/**
* Reverts the effects of the `register_globals` PHP setting by unsetting
* all global varibles except for the default super globals (GPCS, etc),
* all global variables except for the default super globals (GPCS, etc),
* which is a [potential security hole.][ref-wikibooks]
*
* This is called automatically by [Kohana::init] if `register_globals` is
@@ -521,7 +521,7 @@ class Kohana_Core {
/**
* Provides auto-loading support of classes that follow Kohana's old class
* naming conventions.
*
*
* This is included for compatibility purposes with older modules.
*
* @param string $class Class name
@@ -927,7 +927,7 @@ class Kohana_Core {
}
/**
* Get a message from a file. Messages are arbitary strings that are stored
* Get a message from a file. Messages are arbitrary strings that are stored
* in the `messages/` directory and reference by a key. Translation is not
* performed on the returned values. See [message files](kohana/files/messages)
* for more information.
@@ -1037,7 +1037,7 @@ class Kohana_Core {
/**
* Generates a version string based on the variables defined above.
*
*
* @return string
*/
public static function version()
@@ -1045,4 +1045,4 @@ class Kohana_Core {
return 'Kohana Framework '.Kohana::VERSION.' ('.Kohana::CODENAME.')';
}
} // End Kohana
}

View File

@@ -600,4 +600,4 @@ class Kohana_Date {
return $time->format($timestamp_format);
}
} // End date
}

View File

@@ -5,8 +5,8 @@
* @package Kohana
* @category Base
* @author Kohana Team
* @copyright (c) 2008-2012 Kohana Team
* @license http://kohanaphp.com/license
* @copyright (c) 2008-2014 Kohana Team
* @license http://kohanaframework.org/license
*/
class Kohana_Debug {

View File

@@ -210,4 +210,4 @@ class Kohana_Encrypt {
return rtrim(mcrypt_decrypt($this->_cipher, $this->_key, $data, $this->_mode, $iv), "\0");
}
} // End Encrypt
}

View File

@@ -182,4 +182,4 @@ class Kohana_Feed {
return $feed;
}
} // End Feed
}

View File

@@ -163,16 +163,16 @@ class Kohana_File {
// Write files in 8k blocks
$block_size = 1024 * 8;
// Total number of peices
$peices = 0;
// Total number of pieces
$pieces = 0;
while ( ! feof($file))
{
// Create another piece
$peices += 1;
$pieces += 1;
// Create a new file piece
$piece = str_pad($peices, 3, '0', STR_PAD_LEFT);
$piece = str_pad($pieces, 3, '0', STR_PAD_LEFT);
$piece = fopen($filename.'.'.$piece, 'wb+');
// Number of bytes read
@@ -195,7 +195,7 @@ class Kohana_File {
// Close the file
fclose($file);
return $peices;
return $pieces;
}
/**
@@ -214,7 +214,7 @@ class Kohana_File {
// Read files in 8k blocks
$block_size = 1024 * 8;
// Total number of peices
// Total number of pieces
$pieces = 0;
while (is_file($piece = $filename.'.'.str_pad($pieces + 1, 3, '0', STR_PAD_LEFT)))
@@ -231,11 +231,11 @@ class Kohana_File {
fwrite($file, fread($piece, $block_size));
}
// Close the peice
// Close the piece
fclose($piece);
}
return $pieces;
}
} // End file
}

View File

@@ -2,7 +2,7 @@
/**
* Form helper class. Unless otherwise noted, all generated HTML will be made
* safe using the [HTML::chars] method. This prevents against simple XSS
* attacks that could otherwise be trigged by inserting HTML characters into
* attacks that could otherwise be triggered by inserting HTML characters into
* form fields.
*
* @package Kohana
@@ -431,4 +431,4 @@ class Kohana_Form {
return '<label'.HTML::attributes($attributes).'>'.$text.'</label>';
}
} // End form
}

View File

@@ -144,4 +144,4 @@ class Kohana_Fragment {
Kohana::cache(Fragment::_cache_key($name, $i18n), NULL, -3600);
}
} // End Fragment
}

View File

@@ -342,4 +342,4 @@ class Kohana_HTML {
return $compiled;
}
} // End html
}

View File

@@ -11,8 +11,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
*/
abstract class Kohana_HTTP {
@@ -44,7 +44,7 @@ abstract class Kohana_HTTP {
* Checks the browser cache to see the response needs to be returned,
* execution will halt and a 304 Not Modified will be sent if the
* browser cache is up to date.
*
*
* @param Request $request Request
* @param Response $response Response
* @param string $etag Resource ETag
@@ -214,4 +214,5 @@ abstract class Kohana_HTTP {
return implode('&', $encoded);
}
} // End Kohana_HTTP
}

View File

@@ -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
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_300 extends HTTP_Exception_Redirect {
*/
protected $_code = 300;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_301 extends HTTP_Exception_Redirect {
*/
protected $_code = 301;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_302 extends HTTP_Exception_Redirect {
*/
protected $_code = 302;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_303 extends HTTP_Exception_Redirect {
*/
protected $_code = 303;
}
}

View File

@@ -6,5 +6,5 @@ class Kohana_HTTP_Exception_304 extends HTTP_Exception_Expected {
* @var integer HTTP 304 Not Modified
*/
protected $_code = 304;
}
}

View File

@@ -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;
}
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_307 extends HTTP_Exception_Redirect {
*/
protected $_code = 307;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_400 extends HTTP_Exception {
*/
protected $_code = 400;
}
}

View File

@@ -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;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_402 extends HTTP_Exception {
*/
protected $_code = 402;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_403 extends HTTP_Exception {
*/
protected $_code = 403;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_404 extends HTTP_Exception {
*/
protected $_code = 404;
}
}

View File

@@ -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;
}
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_406 extends HTTP_Exception {
*/
protected $_code = 406;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_407 extends HTTP_Exception {
*/
protected $_code = 407;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_408 extends HTTP_Exception {
*/
protected $_code = 408;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_409 extends HTTP_Exception {
*/
protected $_code = 409;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_410 extends HTTP_Exception {
*/
protected $_code = 410;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_411 extends HTTP_Exception {
*/
protected $_code = 411;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_412 extends HTTP_Exception {
*/
protected $_code = 412;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_413 extends HTTP_Exception {
*/
protected $_code = 413;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_414 extends HTTP_Exception {
*/
protected $_code = 414;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_415 extends HTTP_Exception {
*/
protected $_code = 415;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_416 extends HTTP_Exception {
*/
protected $_code = 416;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_417 extends HTTP_Exception {
*/
protected $_code = 417;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_500 extends HTTP_Exception {
*/
protected $_code = 500;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_501 extends HTTP_Exception {
*/
protected $_code = 501;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_502 extends HTTP_Exception {
*/
protected $_code = 502;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_503 extends HTTP_Exception {
*/
protected $_code = 503;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_504 extends HTTP_Exception {
*/
protected $_code = 504;
}
}

View File

@@ -7,4 +7,4 @@ class Kohana_HTTP_Exception_505 extends HTTP_Exception {
*/
protected $_code = 505;
}
}

View File

@@ -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
}

Some files were not shown because too many files have changed in this diff Show More