diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-01-06 17:05:00 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-06 17:05:00 -0800 |
commit | 10c05c855a1634a60048a52e8d90bc51f187ede7 (patch) | |
tree | b65a9d3b2f2213503e3f143b18af6ebd831bc554 | |
parent | 058a84ed76df96aeb6ec082d16fe0d8f317faac2 (diff) | |
parent | ded8fc593cccaf66236fb271a6d3f962d8c4b337 (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
81 files changed, 491 insertions, 288 deletions
diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt index c1fffe6a..beabee49 100644 --- a/modules/gallery/tests/controller_auth_data.txt +++ b/modules/gallery/tests/controller_auth_data.txt @@ -13,7 +13,7 @@ modules/gallery/controllers/login.php ajax modules/gallery/controllers/login.php auth_ajax DIRTY_AUTH modules/gallery/controllers/login.php html DIRTY_AUTH modules/gallery/controllers/login.php auth_html DIRTY_AUTH -modules/gallery/controllers/logout.php index DIRTY_CSRF|DIRTY_AUTH +modules/gallery/controllers/logout.php index DIRTY_AUTH modules/gallery/controllers/maintenance.php index DIRTY_AUTH modules/gallery/controllers/quick.php form_edit DIRTY_CSRF modules/gallery/controllers/simple_uploader.php start DIRTY_AUTH diff --git a/system/config/cache.php b/system/config/cache.php index 76af4f6a..6b2f7871 100644 --- a/system/config/cache.php +++ b/system/config/cache.php @@ -1,25 +1,31 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Cache - * * Cache settings, defined as arrays, or "groups". If no group name is * used when loading the cache library, the group named "default" will be used. * * Each group can be used independently, and multiple groups can be used at once. * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** * Group Options: - * driver - Cache backend driver. Kohana comes with file, database, and memcache drivers. - * > File cache is fast and reliable, but requires many filesystem lookups. - * > Database cache can be used to cache items remotely, but is slower. - * > Memcache is very high performance, but prevents cache tags from being used. * - * params - Driver parameters, specific to each driver. + * - driver - Cache backend driver. Kohana comes with file, database, and memcache drivers. + * - File cache is fast and reliable, but requires many filesystem lookups. + * - Database cache can be used to cache items remotely, but is slower. + * - Memcache is very high performance, but prevents cache tags from being used. + * + * - params - Driver parameters, specific to each driver. * - * lifetime - Default lifetime of caches in seconds. By default caches are stored for + * - lifetime - Default lifetime of caches in seconds. By default caches are stored for * thirty minutes. Specific lifetime can also be set when creating a new cache. * Setting this to 0 will never automatically delete caches. * - * prefix - Adds a prefix to all keys and tags. This can have a severe performance impact. + * - prefix - Adds a prefix to all keys and tags. This can have a severe performance impact. * */ $config['default'] = array diff --git a/system/config/cookie.php b/system/config/cookie.php index d370ecf0..5340f05d 100644 --- a/system/config/cookie.php +++ b/system/config/cookie.php @@ -1,38 +1,55 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Core + * Cookie config settings. These are the default settings used by the [cookie] + * helper. You can override these settings by passing parameters to the cookie + * helper functions. * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** * Domain, to restrict the cookie to a specific website domain. For security, * you are encouraged to set this option. An empty setting allows the cookie * to be read by any website domain. + * @default '' */ $config['domain'] = ''; /** * Restrict cookies to a specific path, typically the installation directory. + * @default '/' */ $config['path'] = '/'; /** * Lifetime of the cookie. A setting of 0 makes the cookie active until the * users browser is closed or the cookie is deleted. + * @default = 0 */ $config['expire'] = 0; /** * Enable this option to only allow the cookie to be read when using the a * secure protocol. + * @default FALSE */ $config['secure'] = FALSE; /** * Enable this option to make the cookie accessible only through the * HTTP protocol (e.g. no javascript access). This is not supported by all browsers. + * @default FALSE */ $config['httponly'] = FALSE; /** * Cookie salt for signed cookies. * Make sure you change this to a unique value. + * + * [!!] Changing this value will invalidate all existing cookies! + * @default 'K0hAN4 15 Th3 B357' */ $config['salt'] = 'K0hAN4 15 Th3 B357';
\ No newline at end of file diff --git a/system/config/credit_cards.php b/system/config/credit_cards.php index bfc98420..46c6afb7 100644 --- a/system/config/credit_cards.php +++ b/system/config/credit_cards.php @@ -1,11 +1,21 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** * Credit card validation configuration. - * + * * Options for each credit card: - * length - All the allowed card number lengths, in a comma separated string - * prefix - The digits the card needs to start with, in regex format - * luhn - Enable or disable card number validation by the Luhn algorithm + * + * - length - All the allowed card number lengths, in a comma separated string + * - prefix - The digits the card needs to start with, in regex format + * - luhn - Enable or disable card number validation by the Luhn algorithm + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** + * Default credit card configuration */ $config = array ( diff --git a/system/config/database.php b/system/config/database.php index 36e4614c..dd6bf469 100644 --- a/system/config/database.php +++ b/system/config/database.php @@ -1,27 +1,34 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Database - * * Database connection settings, defined as arrays, or "groups". If no group * name is used when loading the database library, the group named "default" * will be used. * * Each group can be connected to independently, and multiple groups can be - * connected at once. + * connected at once. For more information about connecting to a database group + * see the [Database] library. * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** * Group Options: - * benchmark - Enable or disable database benchmarking - * persistent - Enable or disable a persistent connection - * connection - Array of connection specific parameters; alternatively, + * + * - benchmark - Enable or disable database benchmarking + * - persistent - Enable or disable a persistent connection + * - connection - Array of connection specific parameters; alternatively, * you can use a DSN though it is not as fast and certain * characters could create problems (like an '@' character * in a password): * 'connection' => 'mysql://dbuser:secret@localhost/kohana' - * character_set - Database character set - * table_prefix - Database table prefix - * object - Enable or disable object results - * cache - Enable or disable query caching - * escape - Enable automatic query builder escaping + * - character_set - Database character set + * - table_prefix - Database table prefix + * - object - Enable or disable object results + * - cache - Enable or disable query caching + * - escape - Enable automatic query builder escaping */ $config['default'] = array ( diff --git a/system/config/encryption.php b/system/config/encryption.php index 589a9def..12ff7ae5 100644 --- a/system/config/encryption.php +++ b/system/config/encryption.php @@ -1,27 +1,35 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Encrypt - * * Encrypt configuration is defined in groups which allows you to easily switch * between different encryption settings for different uses. - * Note: all groups inherit and overwrite the default group. * + * [!!] All groups inherit and overwrite the default group. + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** * Group Options: - * key - Encryption key used to do encryption and decryption. The default option + * + * For best security, your encryption key should be at least 16 characters + * long and contain letters, numbers, and symbols. + * + * - key - Encryption key used to do encryption and decryption. The default option * should never be used for a production website. * - * For best security, your encryption key should be at least 16 characters - * long and contain letters, numbers, and symbols. - * @note Do not use a hash as your key. This significantly lowers encryption entropy. + * [!!] Do not use a hash as your key. This significantly lowers encryption entropy. * - * mode - MCrypt encryption mode. By default, MCRYPT_MODE_NOFB is used. This mode + * - mode - MCrypt encryption mode. By default, MCRYPT_MODE_NOFB is used. This mode * offers initialization vector support, is suited to short strings, and * produces the shortest encrypted output. - * @see http://php.net/mcrypt * - * cipher - MCrypt encryption cipher. By default, the MCRYPT_RIJNDAEL_128 cipher is used. + * - cipher - MCrypt encryption cipher. By default, the MCRYPT_RIJNDAEL_128 cipher is used. * This is also known as 128-bit AES. - * @see http://php.net/mcrypt + * + * For more information about mcrypt modes and cipers see the [mcrypt php docs](http://php.net/mcrypt). */ $config['default'] = array ( diff --git a/system/config/http.php b/system/config/http.php index 3c4a86ac..7cc11dd3 100644 --- a/system/config/http.php +++ b/system/config/http.php @@ -1,6 +1,17 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); +/** + * HTTP Config + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ -// HTTP-EQUIV type meta tags +/** + * HTTP-EQUIV type meta tags + * + */ $config['meta_equiv'] = array ( 'cache-control', diff --git a/system/config/image.php b/system/config/image.php index e38b7cb2..976315cd 100644 --- a/system/config/image.php +++ b/system/config/image.php @@ -1,8 +1,17 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Image + * Image library config * - * Driver name. Default: GD + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** + * Image driver + * + * @default: 'GD' */ $config['driver'] = 'GD'; diff --git a/system/config/inflector.php b/system/config/inflector.php index b6cb8003..70744f56 100644 --- a/system/config/inflector.php +++ b/system/config/inflector.php @@ -1,4 +1,14 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); +/** + * Inflector Config. Lists of words that are uncountable or irregular. + * If you would like to add a word to these lists please open a new issue on the + * [issue tracker](http://dev.kohanaphp.com/projects/kohana2/issues) + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ $config['uncountable'] = array ( diff --git a/system/config/locale.php b/system/config/locale.php index a62b4c3e..3f73b8f1 100644 --- a/system/config/locale.php +++ b/system/config/locale.php @@ -1,7 +1,15 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Core + * Set your default language and timezone here. For more information about + * i18n support see the [i18n] library. * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** * Default language locale name(s). * First item must be a valid i18n directory name, subsequent items are alternative locales * for OS's that don't support the first (e.g. Windows). The first valid locale in the array will be used. @@ -11,7 +19,8 @@ $config['language'] = array('en_US', 'English_United States'); /** * Locale timezone. Defaults to the timezone you have set in your php config - * This cannot be left empty, a valid timezone is required! + * + * [!!] This cannot be left empty, a valid timezone is required! * @see http://php.net/timezones */ $config['timezone'] = ini_get('date.timezone');
\ No newline at end of file diff --git a/system/config/log.php b/system/config/log.php index 5be2c41e..3b437771 100644 --- a/system/config/log.php +++ b/system/config/log.php @@ -1,7 +1,16 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); +/** + * Log Config + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ - -// Different log levels +/** + * Different log levels + */ $config['log_levels'] = array ( 'error' => 1, @@ -10,10 +19,17 @@ $config['log_levels'] = array 'debug' => 4, ); -// See different log levels above +/** + * See different log levels above + */ $config['log_threshold'] = 1; +/** + * Log Date format + */ $config['date_format'] = 'Y-m-d H:i:s P'; -// We can define multiple logging backends at the same time. +/** + * We can define multiple logging backends at the same time. + */ $config['drivers'] = array('file');
\ No newline at end of file diff --git a/system/config/mimes.php b/system/config/mimes.php index c4318d58..f8f8aaf0 100644 --- a/system/config/mimes.php +++ b/system/config/mimes.php @@ -1,14 +1,18 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Core - * * A list of mime types. Our list is generally more complete and accurate than * the operating system MIME list. * * If there are any missing options, please create a ticket on our issue tracker, * http://dev.kohanaphp.com/projects/kohana2. Be sure to give the filename and * expected MIME type, as well as any additional information you can provide. + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license */ + $config = array ( '323' => array('text/h323'), diff --git a/system/config/profiler.php b/system/config/profiler.php index 90532f07..d30a1b45 100644 --- a/system/config/profiler.php +++ b/system/config/profiler.php @@ -1,10 +1,14 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Profiler - * * Array of section names to display in the Profiler, TRUE to display all of them. * Built in sections are benchmarks, database, session, post and cookies, custom sections can be used too. + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license */ + $config['show'] = TRUE; $config['time_decimals'] = 3; diff --git a/system/config/routes.php b/system/config/routes.php index c677fde0..fff890c9 100644 --- a/system/config/routes.php +++ b/system/config/routes.php @@ -1,7 +1,58 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Core + * ##### Custom Routes + * Before changing this file you should copy it to your application/config directory. * + * [!!] Routes will run in the order they are defined. Higher routes will always take precedence over lower ones. + * + * __Default Route__ + * + * $config['_default'] = 'welcome'; + * + * $config['_default'] specifies the default route. It is used to indicate which controller + * should be used when a URI contains no segments. For example, if your web application is at + * www.example.com and you visit this address with a web browser, the welcome controller would + * be used even though it wasn't specified in the URI. The result would be the same as if the + * browser had gone to www.example.com/welcome. + * + * __Custom Routes__ + * + * In addition to the default route above, you can also specify your own routes. The basic + * format for a routing rule is: + * + * $config['route'] = 'class/method'; + * + * Where *route* is the URI you want to route, and *class/method* would replace it. + * + * For example, if your Kohana web application was installed at www.example.com and + * you had the following routing rule: `$config['test'] = 'foo/bar';` + * Browsing to www.example.com/test would be *internally* redirected to www.example.com/foo/bar. + * + * __Advanced Routes with Regex__ + * + * The route part of a routing rule is actually a regular expression. If you are unfamiliar + * with regular expressions you can read more about them at the PHP website. Using regular expressions, + * you can be more selective about which URIs will match your routing rules, and you can make use of the + * sub-pattern back referencing technique to re-use parts of the URI in it's replacement. + * + * This is best described with an example. Suppose we wanted to make the URL www.example.com/article/22 + * work, we might use a routing rule like this: + * + * $config['article/([0-9]+)'] = 'news/show/$1'; + * + * which would match URIs starting with “article/” followed by some numeric digits. If the URI takes this + * form, we will use the news controller and call it's show() method passing in the article number as the + * first argument. In the www.example.com/article/22 example, it is as if the URL www.example.com/news/show/22 + * had been visited. + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + + +/** * Sets the default route to "welcome" */ $config['_default'] = 'welcome'; diff --git a/system/config/session.php b/system/config/session.php index 29eeafbd..a758305c 100644 --- a/system/config/session.php +++ b/system/config/session.php @@ -1,6 +1,14 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Session + * Session Config + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** * * Session driver name. */ diff --git a/system/config/sql_types.php b/system/config/sql_types.php index 43a13c27..6a503290 100644 --- a/system/config/sql_types.php +++ b/system/config/sql_types.php @@ -1,10 +1,16 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Database + * SQL data types. If there are missing values, please report them + * at the [issue tracker](http://dev.kohanaphp.com/projects/kohana2/issues) * - * SQL data types. If there are missing values, please report them: - * - * @link http://dev.kohanaphp.com/projects/kohana2 + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** + * Database sql types */ $config = array ( diff --git a/system/config/upload.php b/system/config/upload.php index df26a2d2..833082c5 100644 --- a/system/config/upload.php +++ b/system/config/upload.php @@ -1,7 +1,14 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Core + * Upload config * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** * This path is relative to your index file. Absolute paths are also supported. */ $config['directory'] = DOCROOT.'upload'; diff --git a/system/config/user_agents.php b/system/config/user_agents.php index c968aebe..2559e85b 100644 --- a/system/config/user_agents.php +++ b/system/config/user_agents.php @@ -1,12 +1,16 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Core - * * This file contains four arrays of user agent data. It is used by the * User Agent library to help identify browser, platform, robot, and * mobile device data. The array keys are used to identify the device * and the array values are used to set the actual name of the item. + * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license */ + $config['platform'] = array ( 'windows nt 6.0' => 'Windows Vista', @@ -49,8 +53,10 @@ $config['platform'] = array 'unix' => 'Unknown Unix OS', ); -// The order of this array should NOT be changed. Many browsers return -// multiple browser types so we want to identify the sub-type first. +/** + * The order of this array should NOT be changed. Many browsers return + * multiple browser types so we want to identify the sub-type first. + */ $config['browser'] = array ( 'Opera' => 'Opera', @@ -98,7 +104,9 @@ $config['mobile'] = array 'android' => 'Android', ); -// There are hundreds of bots but these are the most common. +/** + * There are hundreds of bots but these are the most common. + */ $config['robot'] = array ( 'googlebot' => 'Googlebot', diff --git a/system/config/view.php b/system/config/view.php index a77af878..b6a25b17 100644 --- a/system/config/view.php +++ b/system/config/view.php @@ -1,7 +1,14 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * @package Core + * View Config * + * @package Kohana + * @author Kohana Team + * @copyright (c) 2007-2009 Kohana Team + * @license http://kohanaphp.com/license + */ + +/** * Allowed non-php view types. Most file extensions are supported. * Do not forget to add a valid MIME type in mimes.php */ diff --git a/system/controllers/template.php b/system/controllers/template.php index 4267ee16..a9b99342 100644 --- a/system/controllers/template.php +++ b/system/controllers/template.php @@ -7,9 +7,9 @@ * To use it, declare your controller to extend this class: * `class Your_Controller extends Template_Controller` * - * $Id: template.php 4679 2009-11-10 01:45:52Z isaiah $ + * $Id: template.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/core/Benchmark.php b/system/core/Benchmark.php index 4b2f78b0..79fadb6b 100644 --- a/system/core/Benchmark.php +++ b/system/core/Benchmark.php @@ -2,9 +2,7 @@ /** * Simple benchmarking. * - * $Id: Benchmark.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/core/Event.php b/system/core/Event.php index a9b88034..ab839f43 100644 --- a/system/core/Event.php +++ b/system/core/Event.php @@ -4,9 +4,7 @@ * to be added to 'events'. Events can be run multiple times, and can also * process event-specific data. By default, Kohana has several system events. * - * $Id: Event.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/core/Kohana.php b/system/core/Kohana.php index 29ca708c..ae056d0e 100644 --- a/system/core/Kohana.php +++ b/system/core/Kohana.php @@ -2,9 +2,7 @@ /** * Provides Kohana-specific helper functions. This is where the magic happens! * - * $Id: Kohana.php 4726 2009-12-23 18:58:53Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/core/Kohana_Config.php b/system/core/Kohana_Config.php index f961f391..9abc5b6c 100644 --- a/system/core/Kohana_Config.php +++ b/system/core/Kohana_Config.php @@ -3,9 +3,7 @@ * Provides a driver-based interface for setting and getting * configuration options for the Kohana environment * - * $Id: Kohana_Config.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package KohanaConfig + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/core/Kohana_Exception.php b/system/core/Kohana_Exception.php index 0cbc472c..bc0efd18 100644 --- a/system/core/Kohana_Exception.php +++ b/system/core/Kohana_Exception.php @@ -2,9 +2,7 @@ /** * Kohana Exceptions * - * $Id: Kohana_Exception.php 4726 2009-12-23 18:58:53Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license @@ -428,6 +426,9 @@ class Kohana_Exception_Core extends Exception { */ public static function debug_path($file) { + // Normalize directory separator + $file = str_replace('\\', '/', $file); + if (strpos($file, APPPATH) === 0) { $file = 'APPPATH/'.substr($file, strlen(APPPATH)); diff --git a/system/helpers/arr.php b/system/helpers/arr.php index a1bde230..19026fa9 100644 --- a/system/helpers/arr.php +++ b/system/helpers/arr.php @@ -2,9 +2,7 @@ /** * Array helper class. * - * $Id: arr.php 4680 2009-11-10 01:57:00Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/cookie.php b/system/helpers/cookie.php index 8a2e3659..3680ae34 100644 --- a/system/helpers/cookie.php +++ b/system/helpers/cookie.php @@ -2,9 +2,7 @@ /** * Cookie helper class. * - * $Id: cookie.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/date.php b/system/helpers/date.php index af7e85bd..0b29d28e 100644 --- a/system/helpers/date.php +++ b/system/helpers/date.php @@ -2,9 +2,7 @@ /** * Date helper class. * - * $Id: date.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/db.php b/system/helpers/db.php index ce7583b7..941bb2e6 100644 --- a/system/helpers/db.php +++ b/system/helpers/db.php @@ -2,9 +2,7 @@ /** * Database helper class. * - * $Id: $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/download.php b/system/helpers/download.php index 58a7ab94..0bdb04d9 100644 --- a/system/helpers/download.php +++ b/system/helpers/download.php @@ -2,9 +2,7 @@ /** * Download helper class. * - * $Id: download.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/expires.php b/system/helpers/expires.php index 5f599e13..81468ce3 100644 --- a/system/helpers/expires.php +++ b/system/helpers/expires.php @@ -2,9 +2,7 @@ /** * Controls headers that effect client caching of pages * - * $Id: expires.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license @@ -15,18 +13,19 @@ class expires_Core { * Sets the amount of time before content expires * * @param integer Seconds before the content expires - * @return integer Timestamp when the content expires + * @param integer Last modified timestamp in seconds(optional) + * @return integer Timestamp when the content expires */ public static function set($seconds = 60, $last_modified=null) { $now = time(); $expires = $now + $seconds; - if (empty($last_modified)) - { - $last_modified = $now; - } + if (empty($last_modified)) + { + $last_modified = $now; + } - header('Last-Modified: '.gmdate('D, d M Y H:i:s T', $last_modified)); + header('Last-Modified: '.gmdate('D, d M Y H:i:s T', $last_modified)); // HTTP 1.0 header('Expires: '.gmdate('D, d M Y H:i:s T', $expires)); @@ -70,7 +69,7 @@ class expires_Core { * @uses expires::get() * * @param integer Maximum age of the content in seconds - * @param integer Last modified timestamp in seconds + * @param integer Last modified timestamp in seconds(optional) * @return integer|boolean Timestamp of the If-Modified-Since header or FALSE when header is lacking or malformed */ public static function check($seconds = 60, $modified=null) @@ -79,10 +78,11 @@ class expires_Core { { $now = time(); - if (empty($modified)) - { - $modified = $now; - } + if (empty($last_modified)) + { + $last_modified = $now; + } + $max_age = $expires - time(); if ($modified <= $last_modified) { diff --git a/system/helpers/feed.php b/system/helpers/feed.php index 4aab1dcd..9831812c 100644 --- a/system/helpers/feed.php +++ b/system/helpers/feed.php @@ -2,9 +2,7 @@ /** * Feed helper class. * - * $Id: feed.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license @@ -23,7 +21,7 @@ class feed_Core { // Check if SimpleXML is installed if( ! function_exists('simplexml_load_file')) throw new Kohana_User_Exception('Feed Error', 'SimpleXML must be installed!'); - + // Make limit an integer $limit = (int) $limit; diff --git a/system/helpers/file.php b/system/helpers/file.php index 0d4a7980..48fbfc14 100644 --- a/system/helpers/file.php +++ b/system/helpers/file.php @@ -2,9 +2,7 @@ /** * File helper class. * - * $Id: file.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/form.php b/system/helpers/form.php index b7c60c24..3d4f8ad7 100644 --- a/system/helpers/form.php +++ b/system/helpers/form.php @@ -2,9 +2,7 @@ /** * Form helper class. * - * $Id: form.php 4699 2009-12-08 18:45:14Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/format.php b/system/helpers/format.php index 9351afda..7494046a 100644 --- a/system/helpers/format.php +++ b/system/helpers/format.php @@ -2,9 +2,7 @@ /** * Format helper class. * - * $Id: format.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/html.php b/system/helpers/html.php index 2d759ac0..c16031d2 100644 --- a/system/helpers/html.php +++ b/system/helpers/html.php @@ -2,9 +2,7 @@ /** * HTML helper class. * - * $Id: html.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/inflector.php b/system/helpers/inflector.php index 5a2910c0..e7237079 100644 --- a/system/helpers/inflector.php +++ b/system/helpers/inflector.php @@ -2,9 +2,7 @@ /** * Inflector helper class. * - * $Id: inflector.php 4722 2009-12-19 17:47:34Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/num.php b/system/helpers/num.php index 42f13bec..c9e98431 100644 --- a/system/helpers/num.php +++ b/system/helpers/num.php @@ -2,9 +2,7 @@ /** * Number helper class. * - * $Id: num.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/remote.php b/system/helpers/remote.php index 37995cdb..d34899ec 100644 --- a/system/helpers/remote.php +++ b/system/helpers/remote.php @@ -2,9 +2,7 @@ /** * Remote url/file helper. * - * $Id: remote.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/request.php b/system/helpers/request.php index 31afee4e..2cc59b20 100644 --- a/system/helpers/request.php +++ b/system/helpers/request.php @@ -2,9 +2,7 @@ /** * Request helper class. * - * $Id: request.php 4692 2009-12-04 15:59:44Z cbandy $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/security.php b/system/helpers/security.php index 33e5118e..7103bd15 100644 --- a/system/helpers/security.php +++ b/system/helpers/security.php @@ -2,9 +2,7 @@ /** * Security helper class. * - * $Id: security.php 4698 2009-12-08 18:39:33Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/text.php b/system/helpers/text.php index ed7f9cbf..bf82f12a 100644 --- a/system/helpers/text.php +++ b/system/helpers/text.php @@ -2,9 +2,7 @@ /** * Text helper class. * - * $Id: text.php 4689 2009-12-02 01:39:24Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/upload.php b/system/helpers/upload.php index 3aec2ac4..62de674f 100644 --- a/system/helpers/upload.php +++ b/system/helpers/upload.php @@ -3,9 +3,7 @@ * Upload helper class for working with the global $_FILES * array and Validation library. * - * $Id: upload.php 4679 2009-11-10 01:45:52Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/url.php b/system/helpers/url.php index 4a94e894..1bc81230 100644 --- a/system/helpers/url.php +++ b/system/helpers/url.php @@ -2,9 +2,7 @@ /** * URL helper class. * - * $Id: url.php 4685 2009-11-30 21:24:06Z isaiah $ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license diff --git a/system/helpers/utf8.php b/system/helpers/utf8.php index 773f6331..0123cfb3 100644 --- a/system/helpers/utf8.php +++ b/system/helpers/utf8.php @@ -12,9 +12,7 @@ * string functions. * @see http://php.net/mbstring * - * $Id$ - * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @copyright (c) 2005 Harry Fuecks diff --git a/system/helpers/valid.php b/system/helpers/valid.php index cffcd7c0..1f7be223 100644 --- a/system/helpers/valid.php +++ b/system/helpers/valid.php @@ -1,10 +1,36 @@ <?php defined('SYSPATH') OR die('No direct access allowed.'); /** - * Validation helper class. + * The Valid Helper provides functions to help validate data. They can be used as standalone static functions or + * as rules for the Validation Library. * - * $Id: valid.php 4679 2009-11-10 01:45:52Z isaiah $ + * ###### Validation Library Example: + * $data = new Validation($_POST); + * $data->add_rules('phone', 'required', 'valid::phone[7, 10, 11, 14]') * - * @package Core + * if ($data->validate()) + * { + * echo 'The phone number is valid'; + * } + * else + * { + * echo Kohana::debug($data->errors()); + * } + * + * [!!] The *valid::* part of the rule is optional, but is recommended to avoid conflicts with php functions. + * + * For more informaiton see the [Validation] Library. + * + * ###### Standalone Example: + * if (valid::phone($_POST['phone'], array(7, 10, 11, 14)) + * { + * echo 'The phone number is valid'; + * } + * else + * { + * echo 'Not valid'; + * } + * + * @package Kohana * @author Kohana Team * @copyright (c) 2007-2009 Kohana Team * @license http://kohanaphp.com/license @@ -12,9 +38,20 @@ class valid_Core { /** - * Validate email, commonly used characters only + * Validate an email address. This method is more strict than valid::email_rfc(); * - * @param string email address + * ###### Example: + * $email = 'bill@gates.com'; + * if (valid::email($email)) + * { + * echo "Valid email"; + * } + * else + * { + * echo "Invalid email"; + * } + * + * @param string A email address * @return boolean */ public static function email($email) @@ -26,6 +63,8 @@ class valid_Core { * Validate the domain of an email address by checking if the domain has a * valid MX record. * + * [!!] This function will always return `TRUE` if the checkdnsrr() function isn't avaliable (All Windows platforms before php 5.3) + * * @param string email address * @return boolean */ @@ -41,8 +80,7 @@ class valid_Core { } /** - * Validate email, RFC compliant version - * Note: This function is LESS strict than valid_email. Choose carefully. + * RFC compliant email validation. This function is __LESS__ strict than [valid::email]. Choose carefully. * * @see Originally by Cal Henderson, modified to fit Kohana syntax standards: * @see http://www.iamcal.com/publish/articles/php/parsing_email/ @@ -70,7 +108,18 @@ class valid_Core { } /** - * Validate URL + * Basic URL validation. + * + * ###### Example: + * $url = 'http://www.kohanaphp.com'; + * if (valid::url($url)) + * { + * echo "Valid url"; + * } + * else + * { + * echo "Invalid url"; + * } * * @param string URL * @return boolean @@ -81,7 +130,9 @@ class valid_Core { } /** - * Validate IP + * Validates an IP Address. This only tests to see if the ip address is valid, + * it doesn't check to see if the ip address is actually in use. Has optional support for + * IPv6, and private ip address ranges. * * @param string IP address * @param boolean allow IPv6 addresses @@ -102,8 +153,19 @@ class valid_Core { } /** - * Validates a credit card number using the Luhn (mod10) formula. - * @see http://en.wikipedia.org/wiki/Luhn_algorithm + * Validates a credit card number using the [Luhn (mod10)](http://en.wikipedia.org/wiki/Luhn_algorithm) + * formula. + * + * ###### Example: + * $cc_number = '4111111111111111'; + * if (valid::credit_card($cc_number, array('visa', 'mastercard'))) + * { + * echo "Valid number"; + * } + * else + * { + * echo "Invalid number"; + * } * * @param integer credit card number * @param string|array card type, or an array of card types @@ -178,7 +240,19 @@ class valid_Core { } /** - * Checks if a phone number is valid. + * Checks if a phone number is valid. This function will strip all non-digit + * characters from the phone number for testing. + * + * ###### Example: + * $phone_number = '(201) 664-0274'; + * if (valid::phone($phone_number)) + * { + * echo "Valid phone number"; + * } + * else + * { + * echo "Invalid phone number"; + * } * * @param string phone number to check * @return boolean @@ -198,7 +272,8 @@ class valid_Core { } /** - * Tests if a string is a valid date string. + * Tests if a string is a valid date using the php + * [strtotime()](http://php.net/strtotime) function * * @param string date to check * @return boolean @@ -266,9 +341,8 @@ class valid_Core { /** * Checks whether a string is a valid number (negative and decimal numbers allowed). - * - * @see Uses locale conversion to allow decimal point to be locale specific. - * @see http://www.php.net/manual/en/function.localeconv.php + * This function uses [localeconv()](http://www.php.net/manual/en/function.localeconv.php) + * to support international number formats. * * @param string input string * @return boolean @@ -318,6 +392,19 @@ class valid_Core { * array(2) would force the number to have 2 decimal places, array(4,2) * would force the number to have 4 digits and 2 decimal places. * + * ###### Example: + * $decimal = '4.5'; + * if (valid::decimal($decimal, array(2,1))) + * { + * echo "Valid decimal"; + * } + * else + * { + * echo "Invalid decimal"; + * } + * + * Output: Invalid decimal + * * @param string input string * @param array decimal format: y or x,y * @return boolean 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 diff --git a/system/messages/kohana/core.php b/system/messages/kohana/core.php index 1361809b..0fa66b02 100644 --- a/system/messages/kohana/core.php +++ b/system/messages/kohana/core.php @@ -2,7 +2,7 @@ /** * Core Kohana messages * - * @package Core + * @package Kohana * @author Kohana Team * @copyright (c) 2009 Kohana Team * @license http://kohanaphp.com/license |