diff options
Diffstat (limited to 'system/libraries')
34 files changed, 82 insertions, 119 deletions
diff --git a/system/libraries/Cache.php b/system/libraries/Cache.php index 024c1888..c7954d37 100644 --- a/system/libraries/Cache.php +++ b/system/libraries/Cache.php @@ -4,9 +4,7 @@ * resources. Caches are identified by a unique string. Tagging of caches is * also supported, and caches can be found and deleted by id or tag. * - * $Id: Cache.php 4605 2009-09-14 17:22:21Z kiall $ - * - * @package Cache + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license @@ -106,7 +104,7 @@ class Cache_Core { if ($this->config['prefix'] !== NULL) { $key = $this->add_prefix($key); - + if ($tags !== NULL) { $tags = $this->add_prefix($tags, FALSE); @@ -132,14 +130,14 @@ class Cache_Core { if ($this->config['prefix'] !== NULL) { $keys = $this->add_prefix($keys, FALSE); - + if ( ! $single) { return $this->strip_prefix($this->driver->get($keys, $single)); } } - + return $this->driver->get($keys, $single); } diff --git a/system/libraries/Cache_Exception.php b/system/libraries/Cache_Exception.php index 040d086d..706dc09a 100644 --- a/system/libraries/Cache_Exception.php +++ b/system/libraries/Cache_Exception.php @@ -1,8 +1,7 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * $Id: Kohana_User_Exception.php 4543 2009-09-04 16:58:56Z nodren $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php index 830c06e5..a1139f6d 100644 --- a/system/libraries/Controller.php +++ b/system/libraries/Controller.php @@ -3,9 +3,8 @@ * Kohana Controller class. The controller class must be extended to work * properly, so this class is defined as abstract. * - * $Id: Controller.php 4721 2009-12-17 23:02:07Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Database.php b/system/libraries/Database.php index 38a38fbf..98e33fa0 100644 --- a/system/libraries/Database.php +++ b/system/libraries/Database.php @@ -2,8 +2,6 @@ /** * Database wrapper. * - * $Id: Database.php 4709 2009-12-10 05:09:35Z isaiah $ - * * @package Kohana * @author Kohana Team * @copyright (c) 2008-2009 Kohana Team diff --git a/system/libraries/Database_Cache_Result.php b/system/libraries/Database_Cache_Result.php index 12ad48ea..3945c42c 100644 --- a/system/libraries/Database_Cache_Result.php +++ b/system/libraries/Database_Cache_Result.php @@ -2,8 +2,6 @@ /** * Cached database result. * - * $Id: Database_Cache_Result.php 4679 2009-11-10 01:45:52Z isaiah $ - * * @package Kohana * @author Kohana Team * @copyright (c) 2008-2009 Kohana Team diff --git a/system/libraries/Database_Exception.php b/system/libraries/Database_Exception.php index 4a9cd83e..0f6bb751 100644 --- a/system/libraries/Database_Exception.php +++ b/system/libraries/Database_Exception.php @@ -2,8 +2,6 @@ /** * Database exceptions. * - * $Id: Database_Exception.php 4679 2009-11-10 01:45:52Z isaiah $ - * * @package Kohana * @author Kohana Team * @copyright (c) 2008-2009 Kohana Team diff --git a/system/libraries/Database_Expression.php b/system/libraries/Database_Expression.php index 3e21ea31..007a0cbb 100644 --- a/system/libraries/Database_Expression.php +++ b/system/libraries/Database_Expression.php @@ -1,9 +1,7 @@ <?php defined('SYSPATH') or die('No direct script access.'); /** * Database expression. - * - * $Id: Database_Expression.php 4679 2009-11-10 01:45:52Z isaiah $ - * + * * @package Kohana * @author Kohana Team * @copyright (c) 2008-2009 Kohana Team diff --git a/system/libraries/Database_Mysql.php b/system/libraries/Database_Mysql.php index a5775037..a325cbcc 100644 --- a/system/libraries/Database_Mysql.php +++ b/system/libraries/Database_Mysql.php @@ -2,8 +2,6 @@ /** * MySQL database connection. * - * $Id: Database_Mysql.php 4712 2009-12-10 21:47:09Z cbandy $ - * * @package Kohana * @author Kohana Team * @copyright (c) 2008-2009 Kohana Team @@ -216,7 +214,7 @@ class Database_Mysql_Core extends Database { $prefix = strlen($this->table_prefix()); $tables = array(); - foreach ($this->query('SHOW TABLES FROM '.$this->escape($this->config['connection']['database']).' LIKE '.$this->quote($this->table_prefix().'%'))->as_array() as $row) + foreach ($this->query('SHOW TABLES LIKE '.$this->quote($this->table_prefix().'%'))->as_array() as $row) { // The value is the table name $tables[] = substr(current($row), $prefix); diff --git a/system/libraries/Database_Mysql_Result.php b/system/libraries/Database_Mysql_Result.php index 020360d1..0f898984 100644 --- a/system/libraries/Database_Mysql_Result.php +++ b/system/libraries/Database_Mysql_Result.php @@ -2,8 +2,6 @@ /** * MySQL database result. * - * $Id: Database_Mysql_Result.php 4679 2009-11-10 01:45:52Z isaiah $ - * * @package Kohana * @author Kohana Team * @copyright (c) 2008-2009 Kohana Team diff --git a/system/libraries/Database_Mysqli.php b/system/libraries/Database_Mysqli.php index 08ed99df..41b635d1 100644 --- a/system/libraries/Database_Mysqli.php +++ b/system/libraries/Database_Mysqli.php @@ -1,9 +1,7 @@ <?php defined('SYSPATH') or die('No direct script access.'); /** * MySQL database connection. - * - * $Id: Database_Mysqli.php 4712 2009-12-10 21:47:09Z cbandy $ - * + * * @package Kohana * @author Kohana Team * @copyright (c) 2008-2009 Kohana Team @@ -30,13 +28,13 @@ class Database_Mysqli_Core extends Database_Mysql { $host = isset($host) ? $host : $socket; $mysqli = mysqli_init(); - + if ( ! $mysqli->real_connect($host, $user, $pass, $database, $port, $socket, $params)) throw new Database_Exception('#:errno: :error', array(':error' => $mysqli->connect_error, ':errno' => $mysqli->connect_errno)); - + $this->connection = $mysqli; - + if (isset($this->config['character_set'])) { // Set the character set diff --git a/system/libraries/Database_Mysqli_Result.php b/system/libraries/Database_Mysqli_Result.php index 3601aeac..f8b7b588 100644 --- a/system/libraries/Database_Mysqli_Result.php +++ b/system/libraries/Database_Mysqli_Result.php @@ -2,8 +2,6 @@ /** * MySQL database result. * - * $Id: Database_Mysqli_Result.php 4679 2009-11-10 01:45:52Z isaiah $ - * * @package Kohana * @author Kohana Team * @copyright (c) 2008-2009 Kohana Team @@ -29,7 +27,7 @@ class Database_Mysqli_Result_Core extends Database_Result { throw new Database_Exception('#:errno: :error [ :query ]', array(':error' => $link->error, ':query' => $sql, - ':errno' => $link->errno)); + ':errno' => $link->errno)); } else { diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index 0fbcfc1b..15d40877 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -4,9 +4,9 @@ * using the MCrypt extension. * @see http://php.net/mcrypt * - * $Id: Encrypt.php 4683 2009-11-14 17:10:53Z isaiah $ + * $Id: Encrypt.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/I18n.php b/system/libraries/I18n.php index 96752e51..9401ddcd 100644 --- a/system/libraries/I18n.php +++ b/system/libraries/I18n.php @@ -2,35 +2,12 @@ /** * Kohana I18N System * - * $Id: I18n.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Cache + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license */ -/** - * Loads the configured driver and validates it. - * - * @param string Text to output - * @param array Key/Value pairs of arguments to replace in the string - * @return string Translated text - */ -function __($string, $args = NULL) -{ - // KOHANA_LOCALE is the default locale, in which all of Kohana's __() calls are written in - if (I18n::get_locale() != Kohana::LOCALE) - { - $string = I18n::get_text($string); - } - - if ($args === NULL) - return $string; - - return strtr($string, $args); -} - class I18n_Core { protected static $locale; @@ -99,5 +76,25 @@ class I18n_Core else return $string; } +} +/** + * Loads the configured driver and validates it. + * + * @param string Text to output + * @param array Key/Value pairs of arguments to replace in the string + * @return string Translated text + */ +function __($string, $args = NULL) +{ + // KOHANA_LOCALE is the default locale, in which all of Kohana's __() calls are written in + if (I18n::get_locale() != Kohana::LOCALE) + { + $string = I18n::get_text($string); + } + + if ($args === NULL) + return $string; + + return strtr($string, $args); } diff --git a/system/libraries/Image.php b/system/libraries/Image.php index dd1e28ab..991c8d54 100644 --- a/system/libraries/Image.php +++ b/system/libraries/Image.php @@ -3,9 +3,7 @@ * Manipulate images using standard methods such as resize, crop, rotate, etc. * This class must be re-initialized for every image you wish to manipulate. * - * $Id: Image.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Image + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Input.php b/system/libraries/Input.php index 7a277317..c6c84fca 100644 --- a/system/libraries/Input.php +++ b/system/libraries/Input.php @@ -2,9 +2,9 @@ /** * Input library. * - * $Id: Input.php 4727 2009-12-23 19:03:05Z isaiah $ + * $Id: Input.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Kohana_404_Exception.php b/system/libraries/Kohana_404_Exception.php index 8c7cc787..7bb77084 100644 --- a/system/libraries/Kohana_404_Exception.php +++ b/system/libraries/Kohana_404_Exception.php @@ -2,9 +2,9 @@ /** * Creates a "Page Not Found" exception. * - * $Id: Kohana_404_Exception.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: Kohana_404_Exception.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Kohana_Log.php b/system/libraries/Kohana_Log.php index 44ef8af8..5126013e 100644 --- a/system/libraries/Kohana_Log.php +++ b/system/libraries/Kohana_Log.php @@ -2,9 +2,9 @@ /** * Logging class. * - * $Id: Kohana_Log.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: Kohana_Log.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Kohana_PHP_Exception.php b/system/libraries/Kohana_PHP_Exception.php index 019c686b..779c229a 100644 --- a/system/libraries/Kohana_PHP_Exception.php +++ b/system/libraries/Kohana_PHP_Exception.php @@ -2,9 +2,9 @@ /** * Kohana PHP Error Exceptions * - * $Id: Kohana_PHP_Exception.php 4687 2009-11-30 21:59:26Z isaiah $ + * $Id: Kohana_PHP_Exception.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Kohana_User_Exception.php b/system/libraries/Kohana_User_Exception.php index 95b7bc68..a0ec3ac4 100644 --- a/system/libraries/Kohana_User_Exception.php +++ b/system/libraries/Kohana_User_Exception.php @@ -2,9 +2,9 @@ /** * Creates a custom exception message. * - * $Id: Kohana_User_Exception.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: Kohana_User_Exception.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Model.php b/system/libraries/Model.php index 01d16fdd..ee50d50c 100644 --- a/system/libraries/Model.php +++ b/system/libraries/Model.php @@ -2,9 +2,9 @@ /** * Model base class. * - * $Id: Model.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: Model.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/ORM.php b/system/libraries/ORM.php index e2f27bac..60439106 100644 --- a/system/libraries/ORM.php +++ b/system/libraries/ORM.php @@ -8,9 +8,7 @@ * [ref-orm]: http://wikipedia.org/wiki/Object-relational_mapping * [ref-act]: http://wikipedia.org/wiki/Active_record * - * $Id: ORM.php 4711 2009-12-10 20:40:52Z isaiah $ - * - * @package ORM + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/ORM_Iterator.php b/system/libraries/ORM_Iterator.php index 403d1e93..0bf2b477 100644 --- a/system/libraries/ORM_Iterator.php +++ b/system/libraries/ORM_Iterator.php @@ -1,14 +1,12 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** -* Object Relational Mapping (ORM) result iterator. -* -* $Id: ORM_Iterator.php 4679 2009-11-10 01:45:52Z isaiah $ -* -* @package ORM -* @author Kohana Team -* @copyright (c) 2007-2009 Kohana Team -* @license http://kohanaphp.com/license -*/ + * Object Relational Mapping (ORM) result iterator. + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ class ORM_Iterator_Core implements Iterator, ArrayAccess, Countable { // Class attributes diff --git a/system/libraries/ORM_Validation_Exception.php b/system/libraries/ORM_Validation_Exception.php index 95f96c3b..9044aa6c 100644 --- a/system/libraries/ORM_Validation_Exception.php +++ b/system/libraries/ORM_Validation_Exception.php @@ -1,26 +1,24 @@ <?php defined('SYSPATH') or die('No direct script access.'); /** * ORM Validation exceptions. - * - * $Id: ORM_Validation_Exception.php 4679 2009-11-10 01:45:52Z isaiah $ - * + * * @package Kohana * @author Kohana Team * @copyright (c) 2008-2009 Kohana Team * @license http://kohanaphp.com/license */ class ORM_Validation_Exception_Core extends Database_Exception { - + /** * Handles Database Validation Exceptions - * + * * @param Validation $array - * @return + * @return */ - public static function handle_validation($table, Validation $array) + public static function handle_validation($table, Validation $array) { $exception = new ORM_Validation_Exception('ORM Validation has failed for :table model',array(':table'=>$table)); $exception->validation = $array; throw $exception; - } + } } // End ORM_Validation_Exception
\ No newline at end of file diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 940e365d..3ac8707e 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -8,9 +8,7 @@ * POST Data - The name and values of any POST data submitted to the current page. * Cookie Data - All cookies sent for the current request. * - * $Id: Profiler.php 4719 2009-12-17 04:31:48Z isaiah $ - * - * @package Profiler + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Profiler_Table.php b/system/libraries/Profiler_Table.php index fdb62aef..e590ad7d 100644 --- a/system/libraries/Profiler_Table.php +++ b/system/libraries/Profiler_Table.php @@ -2,9 +2,7 @@ /** * Provides a table layout for sections in the Profiler library. * - * $Id: Profiler_Table.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Profiler + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 18e01af2..c36121df 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -2,9 +2,9 @@ /** * Router * - * $Id: Router.php 4693 2009-12-04 17:11:16Z cbandy $ + * $Id: Router.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 9764a35c..e57908e1 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -2,9 +2,9 @@ /** * Session library. * - * $Id: Session.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: Session.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/URI.php b/system/libraries/URI.php index 4df54fc0..16d101a7 100644 --- a/system/libraries/URI.php +++ b/system/libraries/URI.php @@ -2,9 +2,9 @@ /** * URI library. * - * $Id: URI.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: URI.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 47f34584..9917fbbc 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -2,9 +2,7 @@ /** * Validation library. * - * $Id: Validation.php 4713 2009-12-10 22:25:38Z isaiah $ - * - * @package Validation + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/View.php b/system/libraries/View.php index d7e5e774..ba482bb8 100644 --- a/system/libraries/View.php +++ b/system/libraries/View.php @@ -3,9 +3,9 @@ * Loads and displays Kohana view files. Can also handle output of some binary * files, such as image, Javascript, and CSS files. * - * $Id: View.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: View.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/drivers/Session.php b/system/libraries/drivers/Session.php index 759ccd84..e591b917 100644 --- a/system/libraries/drivers/Session.php +++ b/system/libraries/drivers/Session.php @@ -2,9 +2,9 @@ /** * Session driver interface * - * $Id: Session.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: Session.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/drivers/Session/Cache.php b/system/libraries/drivers/Session/Cache.php index c0d4d0a4..459f8b0e 100644 --- a/system/libraries/drivers/Session/Cache.php +++ b/system/libraries/drivers/Session/Cache.php @@ -10,9 +10,9 @@ * Lifetime does not need to be set as it is * overridden by the session expiration setting. * - * $Id: Cache.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: Cache.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/drivers/Session/Cookie.php b/system/libraries/drivers/Session/Cookie.php index ef575cab..88f5e218 100644 --- a/system/libraries/drivers/Session/Cookie.php +++ b/system/libraries/drivers/Session/Cookie.php @@ -2,9 +2,9 @@ /** * Session cookie driver. * - * $Id: Cookie.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: Cookie.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/libraries/drivers/Session/Database.php b/system/libraries/drivers/Session/Database.php index cbe76001..7b372d2d 100644 --- a/system/libraries/drivers/Session/Database.php +++ b/system/libraries/drivers/Session/Database.php @@ -2,9 +2,9 @@ /** * Session database driver. * - * $Id: Database.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: Database.php 4729 2009-12-29 20:35:19Z isaiah $ * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license |