mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-04 12:09:08 -04:00
Updated Kohana to r4737
This commit is contained in:
@@ -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.
|
||||
*
|
||||
* lifetime - Default lifetime of caches in seconds. By default caches are stored for
|
||||
* - params - Driver parameters, specific to each driver.
|
||||
*
|
||||
* - 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
|
||||
|
||||
@@ -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';
|
||||
@@ -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
|
||||
(
|
||||
|
||||
@@ -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
|
||||
(
|
||||
|
||||
@@ -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
|
||||
(
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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
|
||||
(
|
||||
|
||||
@@ -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');
|
||||
@@ -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');
|
||||
@@ -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'),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
(
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,19 +69,20 @@ 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)
|
||||
public static function check($seconds = 60, $modified=null))
|
||||
{
|
||||
if ($last_modified = expires::get())
|
||||
{
|
||||
$now = time();
|
||||
|
||||
if (empty($modified))
|
||||
{
|
||||
$modified = $now;
|
||||
}
|
||||
if (empty($last_modified))
|
||||
{
|
||||
$last_modified = $now;
|
||||
}
|
||||
$max_age = $expires - time();
|
||||
|
||||
if ($modified <= $last_modified)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Core Kohana messages
|
||||
*
|
||||
* @package Core
|
||||
* @package Kohana
|
||||
* @author Kohana Team
|
||||
* @copyright (c) 2009 Kohana Team
|
||||
* @license http://kohanaphp.com/license
|
||||
|
||||
Reference in New Issue
Block a user