diff options
176 files changed, 5962 insertions, 2184 deletions
diff --git a/application/config/autoload.php b/application/config/autoload.php index 53129c9c6..a45567b22 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -1,4 +1,30 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + /* | ------------------------------------------------------------------- | AUTO-LOADER diff --git a/application/config/config.php b/application/config/config.php index a6d10d8dc..063c3d5d1 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -1,4 +1,29 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ /* |-------------------------------------------------------------------------- @@ -228,6 +253,9 @@ $config['cache_path'] = ''; | | If you use the Encryption class or the Session class you | MUST set an encryption key. See the user guide for info. +| +| http://codeigniter.com/user_guide/libraries/encryption.html +| http://codeigniter.com/user_guide/libraries/sessions.html | */ $config['encryption_key'] = ''; diff --git a/application/config/constants.php b/application/config/constants.php index 4a879d360..3b79a0363 100644 --- a/application/config/constants.php +++ b/application/config/constants.php @@ -1,4 +1,29 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ /* |-------------------------------------------------------------------------- @@ -36,6 +61,18 @@ define('FOPEN_READ_WRITE_CREATE', 'a+b'); define('FOPEN_WRITE_CREATE_STRICT', 'xb'); define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); +/* +|-------------------------------------------------------------------------- +| Display Debug backtrace +|-------------------------------------------------------------------------- +| +| If set to TRUE, a backtrace will be displayed along with php errors. If +| error_reporting is disabled, the backtrace will not display, regardless +| of this setting +| +*/ +define('SHOW_DEBUG_BACKTRACE', TRUE); + /* End of file constants.php */ /* Location: ./application/config/constants.php */
\ No newline at end of file diff --git a/application/config/database.php b/application/config/database.php index 5a84a471a..880773d80 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -1,4 +1,29 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ /* | ------------------------------------------------------------------- | DATABASE CONNECTIVITY SETTINGS @@ -16,7 +41,7 @@ | ['username'] The username used to connect to the database | ['password'] The password used to connect to the database | ['database'] The name of the database you want to connect to -| ['dbdriver'] The database type. ie: mysql. Currently supported: +| ['dbdriver'] The database type. e.g.: mysql. Currently supported: mysql, mysqli, pdo, postgre, odbc, mssql, sqlite, oci8 | ['dbprefix'] You can add an optional prefix, which will be added | to the table name when using the Active Record class @@ -37,6 +62,7 @@ | ['autoinit'] Whether or not to automatically initialize the database. | ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections | - good for ensuring strict SQL while developing +| ['failover'] array - A array with 0 or more data for connections if the main should fail. | | The $active_group variable lets you choose which connection group to | make active. By default there is only one group (the 'default' group). @@ -63,7 +89,7 @@ $db['default']['dbcollat'] = 'utf8_general_ci'; $db['default']['swap_pre'] = ''; $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; - +$db['default']['failover'] = array(); /* End of file database.php */ /* Location: ./application/config/database.php */
\ No newline at end of file diff --git a/application/config/doctypes.php b/application/config/doctypes.php index c9f16eedc..48ccc053d 100644 --- a/application/config/doctypes.php +++ b/application/config/doctypes.php @@ -1,4 +1,29 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $_doctypes = array( 'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php index 0b037d537..691762338 100644 --- a/application/config/foreign_chars.php +++ b/application/config/foreign_chars.php @@ -1,4 +1,30 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + /* | ------------------------------------------------------------------- | Foreign Characters diff --git a/application/config/hooks.php b/application/config/hooks.php index a4ad2be6d..000ae514c 100644 --- a/application/config/hooks.php +++ b/application/config/hooks.php @@ -1,4 +1,30 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + /* | ------------------------------------------------------------------------- | Hooks diff --git a/application/config/migration.php b/application/config/migration.php index 1f532f170..4fb027b8e 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -1,71 +1,93 @@ -<?php defined('BASEPATH') OR exit('No direct script access allowed');
-/*
-|--------------------------------------------------------------------------
-| Enable/Disable Migrations
-|--------------------------------------------------------------------------
-|
-| Migrations are disabled by default for security reasons.
-| You should enable migrations whenever you intend to do a schema migration
-| and disable it back when you're done.
-|
-*/
-$config['migration_enabled'] = FALSE;
-
-/*
-|--------------------------------------------------------------------------
-| Migrations table
-|--------------------------------------------------------------------------
-|
-| This is the name of the table that will store the current migrations state.
-| When migrations runs it will store in a database table which migration
-| level the system is at. It then compares the migration level in the this
-| table to the $config['migration_version'] if they are not the same it
-| will migrate up. This must be set.
-|
-*/
-$config['migration_table'] = 'migrations';
-
-
-/*
-|--------------------------------------------------------------------------
-| Auto Migrate To Latest
-|--------------------------------------------------------------------------
-|
-| If this is set to TRUE when you load the migrations class and have
-| $config['migration_enabled'] set to TRUE the system will auto migrate
-| to your latest migration (whatever $config['migration_version'] is
-| set to). This way you do not have to call migrations anywhere else
-| in your code to have the latest migration.
-|
-*/
-$config['migration_auto_latest'] = FALSE;
-
-
-/*
-|--------------------------------------------------------------------------
-| Migrations version
-|--------------------------------------------------------------------------
-|
-| This is used to set migration version that the file system should be on.
-| If you run $this->migration->latest() this is the version that schema will
-| be upgraded / downgraded to.
-|
-*/
-$config['migration_version'] = 0;
-
-
-/*
-|--------------------------------------------------------------------------
-| Migrations Path
-|--------------------------------------------------------------------------
-|
-| Path to your migrations folder.
-| Typically, it will be within your application path.
-| Also, writing permission is required within the migrations path.
-|
-*/
-$config['migration_path'] = APPPATH . 'migrations/';
-
-
-/* End of file migration.php */
-/* Location: ./application/config/migration.php */
\ No newline at end of file +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + +/* +|-------------------------------------------------------------------------- +| Enable/Disable Migrations +|-------------------------------------------------------------------------- +| +| Migrations are disabled by default for security reasons. +| You should enable migrations whenever you intend to do a schema migration +| and disable it back when you're done. +| +*/ +$config['migration_enabled'] = FALSE; + +/* +|-------------------------------------------------------------------------- +| Migrations table +|-------------------------------------------------------------------------- +| +| This is the name of the table that will store the current migrations state. +| When migrations runs it will store in a database table which migration +| level the system is at. It then compares the migration level in the this +| table to the $config['migration_version'] if they are not the same it +| will migrate up. This must be set. +| +*/ +$config['migration_table'] = 'migrations'; + +/* +|-------------------------------------------------------------------------- +| Auto Migrate To Latest +|-------------------------------------------------------------------------- +| +| If this is set to TRUE when you load the migrations class and have +| $config['migration_enabled'] set to TRUE the system will auto migrate +| to your latest migration (whatever $config['migration_version'] is +| set to). This way you do not have to call migrations anywhere else +| in your code to have the latest migration. +| +*/ +$config['migration_auto_latest'] = FALSE; + +/* +|-------------------------------------------------------------------------- +| Migrations version +|-------------------------------------------------------------------------- +| +| This is used to set migration version that the file system should be on. +| If you run $this->migration->current() this is the version that schema will +| be upgraded / downgraded to. +| +*/ +$config['migration_version'] = 0; + +/* +|-------------------------------------------------------------------------- +| Migrations Path +|-------------------------------------------------------------------------- +| +| Path to your migrations folder. +| Typically, it will be within your application path. +| Also, writing permission is required within the migrations path. +| +*/ +$config['migration_path'] = APPPATH . 'migrations/'; + + +/* End of file migration.php */
\ No newline at end of file diff --git a/application/config/mimes.php b/application/config/mimes.php index 6f73ae038..c43f1fc2f 100644 --- a/application/config/mimes.php +++ b/application/config/mimes.php @@ -1,4 +1,30 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + /* | ------------------------------------------------------------------- | MIME TYPES @@ -31,6 +57,7 @@ $mimes = array('hqx' => array('application/mac-binhex40', 'application/mac-binhe 'mif' => 'application/vnd.mif', 'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'), 'ppt' => array('application/powerpoint', 'application/vnd.ms-powerpoint'), + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'wbxml' => 'application/wbxml', 'wmlc' => 'application/wmlc', 'dcr' => 'application/x-director', diff --git a/application/config/profiler.php b/application/config/profiler.php index f8a5b1a1e..b0bd2cd1f 100644 --- a/application/config/profiler.php +++ b/application/config/profiler.php @@ -1,4 +1,30 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + /* | ------------------------------------------------------------------------- | Profiler Sections diff --git a/application/config/routes.php b/application/config/routes.php index f30a0d1f2..b7f4056a5 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -1,4 +1,30 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + /* | ------------------------------------------------------------------------- | URI ROUTING diff --git a/application/config/smileys.php b/application/config/smileys.php index 38f02a9e0..ada329aa1 100644 --- a/application/config/smileys.php +++ b/application/config/smileys.php @@ -1,4 +1,30 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + /* | ------------------------------------------------------------------- | SMILEYS diff --git a/application/config/user_agents.php b/application/config/user_agents.php index 9080b43f6..7f5fe810c 100644 --- a/application/config/user_agents.php +++ b/application/config/user_agents.php @@ -1,4 +1,30 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ + /* | ------------------------------------------------------------------- | USER AGENT TYPES @@ -11,170 +37,178 @@ */ $platforms = array ( - 'windows nt 6.1' => 'Windows 7', - 'windows nt 6.0' => 'Windows Vista', - 'windows nt 5.2' => 'Windows 2003', - 'windows nt 5.1' => 'Windows XP', - 'windows nt 5.0' => 'Windows 2000', - 'windows nt 4.0' => 'Windows NT 4.0', - 'winnt4.0' => 'Windows NT 4.0', - 'winnt 4.0' => 'Windows NT', - 'winnt' => 'Windows NT', - 'windows 98' => 'Windows 98', - 'win98' => 'Windows 98', - 'windows 95' => 'Windows 95', - 'win95' => 'Windows 95', - 'windows' => 'Unknown Windows OS', - 'os x' => 'Mac OS X', - 'ppc mac' => 'Power PC Mac', - 'freebsd' => 'FreeBSD', - 'ppc' => 'Macintosh', - 'linux' => 'Linux', - 'debian' => 'Debian', - 'sunos' => 'Sun Solaris', - 'beos' => 'BeOS', - 'apachebench' => 'ApacheBench', - 'aix' => 'AIX', - 'irix' => 'Irix', - 'osf' => 'DEC OSF', - 'hp-ux' => 'HP-UX', - 'netbsd' => 'NetBSD', - 'bsdi' => 'BSDi', - 'openbsd' => 'OpenBSD', - 'gnu' => 'GNU/Linux', - 'unix' => 'Unknown Unix OS' - ); + 'windows nt 6.1' => 'Windows 7', + 'windows nt 6.0' => 'Windows Vista', + 'windows nt 5.2' => 'Windows 2003', + 'windows nt 5.1' => 'Windows XP', + 'windows nt 5.0' => 'Windows 2000', + 'windows nt 4.0' => 'Windows NT 4.0', + 'winnt4.0' => 'Windows NT 4.0', + 'winnt 4.0' => 'Windows NT', + 'winnt' => 'Windows NT', + 'windows 98' => 'Windows 98', + 'win98' => 'Windows 98', + 'windows 95' => 'Windows 95', + 'win95' => 'Windows 95', + 'windows' => 'Unknown Windows OS', + 'os x' => 'Mac OS X', + 'ppc mac' => 'Power PC Mac', + 'freebsd' => 'FreeBSD', + 'ppc' => 'Macintosh', + 'linux' => 'Linux', + 'debian' => 'Debian', + 'sunos' => 'Sun Solaris', + 'beos' => 'BeOS', + 'apachebench' => 'ApacheBench', + 'aix' => 'AIX', + 'irix' => 'Irix', + 'osf' => 'DEC OSF', + 'hp-ux' => 'HP-UX', + 'netbsd' => 'NetBSD', + 'bsdi' => 'BSDi', + 'openbsd' => 'OpenBSD', + 'gnu' => 'GNU/Linux', + '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. $browsers = array( - 'Flock' => 'Flock', - 'Chrome' => 'Chrome', - 'Opera' => 'Opera', - 'MSIE' => 'Internet Explorer', - 'Internet Explorer' => 'Internet Explorer', - 'Shiira' => 'Shiira', - 'Firefox' => 'Firefox', - 'Chimera' => 'Chimera', - 'Phoenix' => 'Phoenix', - 'Firebird' => 'Firebird', - 'Camino' => 'Camino', - 'Netscape' => 'Netscape', - 'OmniWeb' => 'OmniWeb', - 'Safari' => 'Safari', - 'Mozilla' => 'Mozilla', - 'Konqueror' => 'Konqueror', - 'icab' => 'iCab', - 'Lynx' => 'Lynx', - 'Links' => 'Links', - 'hotjava' => 'HotJava', - 'amaya' => 'Amaya', - 'IBrowse' => 'IBrowse' - ); + 'Flock' => 'Flock', + 'Chrome' => 'Chrome', + 'Opera' => 'Opera', + 'MSIE' => 'Internet Explorer', + 'Internet Explorer' => 'Internet Explorer', + 'Shiira' => 'Shiira', + 'Firefox' => 'Firefox', + 'Chimera' => 'Chimera', + 'Phoenix' => 'Phoenix', + 'Firebird' => 'Firebird', + 'Camino' => 'Camino', + 'Netscape' => 'Netscape', + 'OmniWeb' => 'OmniWeb', + 'Safari' => 'Safari', + 'Mozilla' => 'Mozilla', + 'Konqueror' => 'Konqueror', + 'icab' => 'iCab', + 'Lynx' => 'Lynx', + 'Links' => 'Links', + 'hotjava' => 'HotJava', + 'amaya' => 'Amaya', + 'IBrowse' => 'IBrowse' +); $mobiles = array( - // legacy array, old values commented out - 'mobileexplorer' => 'Mobile Explorer', -// 'openwave' => 'Open Wave', -// 'opera mini' => 'Opera Mini', -// 'operamini' => 'Opera Mini', -// 'elaine' => 'Palm', - 'palmsource' => 'Palm', -// 'digital paths' => 'Palm', -// 'avantgo' => 'Avantgo', -// 'xiino' => 'Xiino', - 'palmscape' => 'Palmscape', -// 'nokia' => 'Nokia', -// 'ericsson' => 'Ericsson', -// 'blackberry' => 'BlackBerry', -// 'motorola' => 'Motorola' + // legacy array, old values commented out + 'mobileexplorer' => 'Mobile Explorer', +// 'openwave' => 'Open Wave', +// 'opera mini' => 'Opera Mini', +// 'operamini' => 'Opera Mini', +// 'elaine' => 'Palm', + 'palmsource' => 'Palm', +// 'digital paths' => 'Palm', +// 'avantgo' => 'Avantgo', +// 'xiino' => 'Xiino', + 'palmscape' => 'Palmscape', +// 'nokia' => 'Nokia', +// 'ericsson' => 'Ericsson', +// 'blackberry' => 'BlackBerry', +// 'motorola' => 'Motorola' - // Phones and Manufacturers - 'motorola' => "Motorola", - 'nokia' => "Nokia", - 'palm' => "Palm", - 'iphone' => "Apple iPhone", - 'ipad' => "iPad", - 'ipod' => "Apple iPod Touch", - 'sony' => "Sony Ericsson", - 'ericsson' => "Sony Ericsson", - 'blackberry' => "BlackBerry", - 'cocoon' => "O2 Cocoon", - 'blazer' => "Treo", - 'lg' => "LG", - 'amoi' => "Amoi", - 'xda' => "XDA", - 'mda' => "MDA", - 'vario' => "Vario", - 'htc' => "HTC", - 'samsung' => "Samsung", - 'sharp' => "Sharp", - 'sie-' => "Siemens", - 'alcatel' => "Alcatel", - 'benq' => "BenQ", - 'ipaq' => "HP iPaq", - 'mot-' => "Motorola", - 'playstation portable' => "PlayStation Portable", - 'hiptop' => "Danger Hiptop", - 'nec-' => "NEC", - 'panasonic' => "Panasonic", - 'philips' => "Philips", - 'sagem' => "Sagem", - 'sanyo' => "Sanyo", - 'spv' => "SPV", - 'zte' => "ZTE", - 'sendo' => "Sendo", + // Phones and Manufacturers + 'motorola' => "Motorola", + 'nokia' => "Nokia", + 'palm' => "Palm", + 'iphone' => "Apple iPhone", + 'ipad' => "iPad", + 'ipod' => "Apple iPod Touch", + 'sony' => "Sony Ericsson", + 'ericsson' => "Sony Ericsson", + 'blackberry' => "BlackBerry", + 'cocoon' => "O2 Cocoon", + 'blazer' => "Treo", + 'lg' => "LG", + 'amoi' => "Amoi", + 'xda' => "XDA", + 'mda' => "MDA", + 'vario' => "Vario", + 'htc' => "HTC", + 'samsung' => "Samsung", + 'sharp' => "Sharp", + 'sie-' => "Siemens", + 'alcatel' => "Alcatel", + 'benq' => "BenQ", + 'ipaq' => "HP iPaq", + 'mot-' => "Motorola", + 'playstation portable' => "PlayStation Portable", + 'hiptop' => "Danger Hiptop", + 'nec-' => "NEC", + 'panasonic' => "Panasonic", + 'philips' => "Philips", + 'sagem' => "Sagem", + 'sanyo' => "Sanyo", + 'spv' => "SPV", + 'zte' => "ZTE", + 'sendo' => "Sendo", + 'dsi' => "Nintendo DSi", + 'ds' => "Nintendo DS", + 'wii' => "Nintendo Wii", + '3ds' => "Nintendo 3DS", + 'open web' => "Open Web", + 'openweb' => "OpenWeb", -// Operating Systems - 'android' => "Android", - 'symbian' => "Symbian", - 'SymbianOS' => "SymbianOS", - 'elaine' => "Palm", - 'palm' => "Palm", - 'series60' => "Symbian S60", - 'windows ce' => "Windows CE", + // Operating Systems + 'android' => "Android", + 'symbian' => "Symbian", + 'SymbianOS' => "SymbianOS", + 'elaine' => "Palm", + 'palm' => "Palm", + 'series60' => "Symbian S60", + 'windows ce' => "Windows CE", - // Browsers - 'obigo' => "Obigo", - 'netfront' => "Netfront Browser", - 'openwave' => "Openwave Browser", - 'mobilexplorer' => "Mobile Explorer", - 'operamini' => "Opera Mini", - 'opera mini' => "Opera Mini", + // Browsers + 'obigo' => "Obigo", + 'netfront' => "Netfront Browser", + 'openwave' => "Openwave Browser", + 'mobilexplorer' => "Mobile Explorer", + 'operamini' => "Opera Mini", + 'opera mini' => "Opera Mini", + 'opera mobi' => "Opera Mobile", - // Other - 'digital paths' => "Digital Paths", - 'avantgo' => "AvantGo", - 'xiino' => "Xiino", - 'novarra' => "Novarra Transcoder", - 'vodafone' => "Vodafone", - 'docomo' => "NTT DoCoMo", - 'o2' => "O2", + // Other + 'digital paths' => "Digital Paths", + 'avantgo' => "AvantGo", + 'xiino' => "Xiino", + 'novarra' => "Novarra Transcoder", + 'vodafone' => "Vodafone", + 'docomo' => "NTT DoCoMo", + 'o2' => "O2", - // Fallback - 'mobile' => "Generic Mobile", - 'wireless' => "Generic Mobile", - 'j2me' => "Generic Mobile", - 'midp' => "Generic Mobile", - 'cldc' => "Generic Mobile", - 'up.link' => "Generic Mobile", - 'up.browser' => "Generic Mobile", - 'smartphone' => "Generic Mobile", - 'cellphone' => "Generic Mobile" - ); + // Fallback + 'mobile' => "Generic Mobile", + 'wireless' => "Generic Mobile", + 'j2me' => "Generic Mobile", + 'midp' => "Generic Mobile", + 'cldc' => "Generic Mobile", + 'up.link' => "Generic Mobile", + 'up.browser' => "Generic Mobile", + 'smartphone' => "Generic Mobile", + 'cellphone' => "Generic Mobile" +); // There are hundreds of bots but these are the most common. $robots = array( - 'googlebot' => 'Googlebot', - 'msnbot' => 'MSNBot', - 'slurp' => 'Inktomi Slurp', - 'yahoo' => 'Yahoo', - 'askjeeves' => 'AskJeeves', - 'fastcrawler' => 'FastCrawler', - 'infoseek' => 'InfoSeek Robot 1.0', - 'lycos' => 'Lycos' - ); + 'googlebot' => 'Googlebot', + 'msnbot' => 'MSNBot', + 'bingbot' => 'Bing', + 'slurp' => 'Inktomi Slurp', + 'yahoo' => 'Yahoo', + 'askjeeves' => 'AskJeeves', + 'fastcrawler' => 'FastCrawler', + 'infoseek' => 'InfoSeek Robot 1.0', + 'lycos' => 'Lycos' +); /* End of file user_agents.php */ -/* Location: ./application/config/user_agents.php */
\ No newline at end of file +/* Location: ./application/config/user_agents.php */ diff --git a/application/controllers/welcome.php b/application/controllers/welcome.php index 21bef43d9..0757f2d79 100644 --- a/application/controllers/welcome.php +++ b/application/controllers/welcome.php @@ -1,4 +1,29 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ class Welcome extends CI_Controller { diff --git a/application/errors/error_404.php b/application/errors/error_404.php index bddee6cc6..eb98deb71 100644 --- a/application/errors/error_404.php +++ b/application/errors/error_404.php @@ -1,3 +1,31 @@ +<?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ +?> + <!DOCTYPE html> <html lang="en"> <head> diff --git a/application/errors/error_db.php b/application/errors/error_db.php index bc7c4478a..a53c38992 100644 --- a/application/errors/error_db.php +++ b/application/errors/error_db.php @@ -1,3 +1,31 @@ +<?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ +?> + <!DOCTYPE html> <html lang="en"> <head> diff --git a/application/errors/error_general.php b/application/errors/error_general.php index 8b3746285..7d9a29f4e 100644 --- a/application/errors/error_general.php +++ b/application/errors/error_general.php @@ -1,3 +1,31 @@ +<?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ +?> + <!DOCTYPE html> <html lang="en"> <head> diff --git a/application/errors/error_php.php b/application/errors/error_php.php index f085c2037..1bf245465 100644 --- a/application/errors/error_php.php +++ b/application/errors/error_php.php @@ -1,3 +1,31 @@ +<?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ +?> + <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> @@ -7,4 +35,21 @@ <p>Filename: <?php echo $filepath; ?></p> <p>Line Number: <?php echo $line; ?></p> +<?php if(defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?> + + <p>Backtrace: </p> + <?php foreach(debug_backtrace() as $error): ?> + + <?php if(isset($error['file']) && ! stristr($error['file'], SYSDIR)): ?> + <p style="margin-left:10px"> + File: <?php echo $error['file'] ?><br /> + Line: <?php echo $error['line'] ?><br /> + Function: <?php echo $error['function'] ?> + </p> + <?php endif ?> + + <?php endforeach ?></p> + +<?php endif ?> + </div>
\ No newline at end of file diff --git a/application/views/welcome_message.php b/application/views/welcome_message.php index d906bc8d7..709045392 100644 --- a/application/views/welcome_message.php +++ b/application/views/welcome_message.php @@ -1,3 +1,31 @@ +<?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Academic Free License version 3.0 + * + * This source file is subject to the Academic Free License (AFL 3.0) that is + * bundled with this package in the files license_afl.txt / license_afl.rst. + * It is also available through the world wide web at this URL: + * http://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ +?> + <!DOCTYPE html> <html lang="en"> <head> @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ /* *--------------------------------------------------------------- diff --git a/license.rst b/license.rst new file mode 100644 index 000000000..17179a95c --- /dev/null +++ b/license.rst @@ -0,0 +1,245 @@ +################################### +Open Software License ("OSL") v 3.0 +################################### + +This Open Software License (the "License") applies to any original work of +authorship (the "Original Work") whose owner (the "Licensor") has placed the +following licensing notice adjacent to the copyright notice for the Original +Work: + +*Licensed under the Open Software License version 3.0* + + +***************************** +1) Grant of Copyright License +***************************** + +Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable +license, for the duration of the copyright, to do the following: + + *a)* to reproduce the Original Work in copies, either alone or as part of + a collective work; + + *b)* to translate, adapt, alter, transform, modify, or arrange the + Original Work, thereby creating derivative works ("Derivative Works") + based upon the Original Work; + + *c)* to distribute or communicate copies of the Original Work and + Derivative Works to the public, *with the proviso that copies of Original + Work or Derivative Works that You distribute or communicate shall be + licensed under this Open Software License*; + + *d)* to perform the Original Work publicly; and + + *e)* to display the Original Work publicly. + + +************************** +2) Grant of Patent License +************************** + +Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable +license, under patent claims owned or controlled by the Licensor that are +embodied in the Original Work as furnished by the Licensor, for the duration +of the patents, to make, use, sell, offer for sale, have made, and import the +Original Work and Derivative Works. + + +******************************* +3) Grant of Source Code License +******************************* + +The term "Source Code" means the preferred form of the Original Work for +making modifications to it and all available documentation describing how to +modify the Original Work. Licensor agrees to provide a machine-readable copy +of the Source Code of the Original Work along with each copy of the Original +Work that Licensor distributes. Licensor reserves the right to satisfy this +obligation by placing a machine-readable copy of the Source Code in an +information repository reasonably calculated to permit inexpensive and +convenient access by You for as long as Licensor continues to distribute the +Original Work. + + +******************************** +4) Exclusions From License Grant +******************************** + +Neither the names of Licensor, nor the names of any contributors to the +Original Work, nor any of their trademarks or service marks, may be used to +endorse or promote products derived from this Original Work without express +prior permission of the Licensor. Except as expressly stated herein, nothing +in this License grants any license to Licensor's trademarks, copyrights, +patents, trade secrets or any other intellectual property. No patent license +is granted to make, use, sell, offer for sale, have made, or import +embodiments of any patent claims other than the licensed claims defined in +Section 2) No license is granted to the trademarks of Licensor even if such +marks are included in the Original Work. Nothing in this License shall be +interpreted to prohibit Licensor from licensing under terms different from +this License any Original Work that Licensor otherwise would have a right to +license. + + +********************** +5) External Deployment +********************** + +The term "External Deployment" means the use, distribution, or communication +of the Original Work or Derivative Works in any way such that the Original +Work or Derivative Works may be used by anyone other than You, whether those +works are distributed or communicated to those persons or made available as an +application intended for use over a network. As an express condition for the +grants of license hereunder, You must treat any External Deployment by You of +the Original Work or a Derivative Work as a distribution under section 1(c). + + +********************* +6) Attribution Rights +********************* + +You must retain, in the Source Code of any Derivative Works that You create, +all copyright, patent, or trademark notices from the Source Code of the +Original Work, as well as any notices of licensing and any descriptive text +identified therein as an "Attribution Notice." You must cause the Source Code +for any Derivative Works that You create to carry a prominent Attribution +Notice reasonably calculated to inform recipients that You have modified the +Original Work. + + +**************************************************** +7) Warranty of Provenance and Disclaimer of Warranty +**************************************************** + +Licensor warrants that the copyright in and to the Original Work and the +patent rights granted herein by Licensor are owned by the Licensor or are +sublicensed to You under the terms of this License with the permission of the +contributor(s) of those copyrights and patent rights. Except as expressly +stated in the immediately preceding sentence, the Original Work is provided +under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or +implied, including, without limitation, the warranties of non-infringement, +merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE +QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY +constitutes an essential part of this License. No license to the Original Work +is granted by this License except under this disclaimer. + + +************************** +8) Limitation of Liability +************************** + +Under no circumstances and under no legal theory, whether in tort (including +negligence), contract, or otherwise, shall the Licensor be liable to anyone +for any indirect, special, incidental, or consequential damages of any +character arising as a result of this License or the use of the Original Work +including, without limitation, damages for loss of goodwill, work stoppage, +computer failure or malfunction, or any and all other commercial damages or +losses. This limitation of liability shall not apply to the extent applicable +law prohibits such limitation. + + +***************************** +9) Acceptance and Termination +***************************** + +If, at any time, You expressly assented to this License, that assent indicates +your clear and irrevocable acceptance of this License and all of its terms and +conditions. If You distribute or communicate copies of the Original Work or a +Derivative Work, You must make a reasonable effort under the circumstances to +obtain the express assent of recipients to the terms of this License. This +License conditions your rights to undertake the activities listed in Section +1, including your right to create Derivative Works based upon the Original +Work, and doing so without honoring these terms and conditions is prohibited +by copyright law and international treaty. Nothing in this License is intended +to affect copyright exceptions and limitations (including "fair use" or "fair +dealing"). This License shall terminate immediately and You may no longer +exercise any of the rights granted to You by this License upon your failure to +honor the conditions in Section 1(c). + + +********************************* +10) Termination for Patent Action +********************************* + +This License shall terminate automatically and You may no longer exercise any +of the rights granted to You by this License as of the date You commence an +action, including a cross-claim or counterclaim, against Licensor or any +licensee alleging that the Original Work infringes a patent. This termination +provision shall not apply for an action alleging patent infringement by +combinations of the Original Work with other software or hardware. + + +***************************************** +11) Jurisdiction, Venue and Governing Law +***************************************** + +Any action or suit relating to this License may be brought only in the courts +of a jurisdiction wherein the Licensor resides or in which Licensor conducts +its primary business, and under the laws of that jurisdiction excluding its +conflict-of-law provisions. The application of the United Nations Convention +on Contracts for the International Sale of Goods is expressly excluded. Any +use of the Original Work outside the scope of this License or after its +termination shall be subject to the requirements and penalties of copyright or +patent law in the appropriate jurisdiction. This section shall survive the +termination of this License. + + +******************* +12) Attorneys' Fees +******************* + +In any action to enforce the terms of this License or seeking damages relating +thereto, the prevailing party shall be entitled to recover its costs and +expenses, including, without limitation, reasonable attorneys' fees and costs +incurred in connection with such action, including any appeal of such action. +This section shall survive the termination of this License. + + +***************** +13) Miscellaneous +***************** + +If any provision of this License is held to be unenforceable, such provision +shall be reformed only to the extent necessary to make it enforceable. + + +*************************************** +14) Definition of "You" in This License +*************************************** + +"You" throughout this License, whether in upper or lower case, means an +individual or a legal entity exercising rights under, and complying with all +of the terms of, this License. For legal entities, "You" includes any entity +that controls, is controlled by, or is under common control with you. For +purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + + +**************** +15) Right to Use +**************** + +You may use the Original Work in all ways not otherwise restricted or +conditioned by this License or by law, and Licensor promises not to interfere +with or be responsible for such uses by You. + + +******************************** +16) Modification of This License +******************************** + +This License is Copyright © 2005 Lawrence Rosen. Permission is granted to +copy, distribute, or communicate this License without modification. Nothing in +this License permits You to modify this License as applied to the Original +Work or to Derivative Works. However, You may modify the text of this License +and copy, distribute or communicate your modified version (the "Modified +License") and apply it to other original works of authorship subject to the +following conditions: (i) You may not indicate in any way that your Modified +License is the "Open Software License" or "OSL" and you may not use those +names in the name of your Modified License; (ii) You must replace the notice +specified in the first paragraph above with the notice "Licensed under <insert +your license name here>" or with a notice of your own that is not confusingly +similar to the notice in this License; and (iii) You may not claim that your +original works are open source software unless your Modified License has been +approved by Open Source Initiative (OSI) and You comply with its license +review and certification process.
\ No newline at end of file diff --git a/license.txt b/license.txt index 061cdb9db..395dcc3a0 100644 --- a/license.txt +++ b/license.txt @@ -1,51 +1,172 @@ -Copyright (c) 2008 - 2011, EllisLab, Inc. -All rights reserved. - -This license is a legal agreement between you and EllisLab Inc. for the use -of CodeIgniter Software (the "Software"). By obtaining the Software you -agree to comply with the terms and conditions of this license. - -PERMITTED USE -You are permitted to use, copy, modify, and distribute the Software and its -documentation, with or without modification, for any purpose, provided that -the following conditions are met: - -1. A copy of this license agreement must be included with the distribution. - -2. Redistributions of source code must retain the above copyright notice in - all source code files. - -3. Redistributions in binary form must reproduce the above copyright notice - in the documentation and/or other materials provided with the distribution. - -4. Any files that have been modified must carry notices stating the nature - of the change and the names of those who changed them. - -5. Products derived from the Software must include an acknowledgment that - they are derived from CodeIgniter in their documentation and/or other - materials provided with the distribution. - -6. Products derived from the Software may not be called "CodeIgniter", - nor may "CodeIgniter" appear in their name, without prior written - permission from EllisLab, Inc. - -INDEMNITY -You agree to indemnify and hold harmless the authors of the Software and -any contributors for any direct, indirect, incidental, or consequential -third-party claims, actions or suits, as well as any related expenses, -liabilities, damages, settlements or fees arising from your use or misuse -of the Software, or a violation of any terms of this license. - -DISCLAIMER OF WARRANTY -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR -IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF QUALITY, PERFORMANCE, -NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. - -LIMITATIONS OF LIABILITY -YOU ASSUME ALL RISK ASSOCIATED WITH THE INSTALLATION AND USE OF THE SOFTWARE. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE SOFTWARE BE LIABLE -FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION -WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR DETERMINING THE -APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE, INCLUDING -BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF -DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS. +Open Software License ("OSL") v 3.0 + +This Open Software License (the "License") applies to any original work of +authorship (the "Original Work") whose owner (the "Licensor") has placed the +following licensing notice adjacent to the copyright notice for the Original +Work: + +Licensed under the Open Software License version 3.0 + +1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, +non-exclusive, sublicensable license, for the duration of the copyright, to do +the following: + + a) to reproduce the Original Work in copies, either alone or as part of a + collective work; + + b) to translate, adapt, alter, transform, modify, or arrange the Original + Work, thereby creating derivative works ("Derivative Works") based + upon the Original Work; + + c) to distribute or communicate copies of the Original Work and Derivative + Works to the public, with the proviso that copies of Original Work or + Derivative Works that You distribute or communicate shall be licensed + under this Open Software License; + + d) to perform the Original Work publicly; and + + e) to display the Original Work publicly. + +2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, +non-exclusive, sublicensable license, under patent claims owned or controlled +by the Licensor that are embodied in the Original Work as furnished by the +Licensor, for the duration of the patents, to make, use, sell, offer for sale, +have made, and import the Original Work and Derivative Works. + +3) Grant of Source Code License. The term "Source Code" means the preferred +form of the Original Work for making modifications to it and all available +documentation describing how to modify the Original Work. Licensor agrees to +provide a machine-readable copy of the Source Code of the Original Work along +with each copy of the Original Work that Licensor distributes. Licensor +reserves the right to satisfy this obligation by placing a machine-readable +copy of the Source Code in an information repository reasonably calculated to +permit inexpensive and convenient access by You for as long as Licensor +continues to distribute the Original Work. + +4) Exclusions From License Grant. Neither the names of Licensor, nor the names +of any contributors to the Original Work, nor any of their trademarks or +service marks, may be used to endorse or promote products derived from this +Original Work without express prior permission of the Licensor. Except as +expressly stated herein, nothing in this License grants any license to +Licensor's trademarks, copyrights, patents, trade secrets or any other +intellectual property. No patent license is granted to make, use, sell, offer +for sale, have made, or import embodiments of any patent claims other than the +licensed claims defined in Section 2. No license is granted to the trademarks +of Licensor even if such marks are included in the Original Work. Nothing in +this License shall be interpreted to prohibit Licensor from licensing under +terms different from this License any Original Work that Licensor otherwise +would have a right to license. + +5) External Deployment. The term "External Deployment" means the use, +distribution, or communication of the Original Work or Derivative Works in any +way such that the Original Work or Derivative Works may be used by anyone +other than You, whether those works are distributed or communicated to those +persons or made available as an application intended for use over a network. +As an express condition for the grants of license hereunder, You must treat +any External Deployment by You of the Original Work or a Derivative Work as a +distribution under section 1(c). + +6) Attribution Rights. You must retain, in the Source Code of any Derivative +Works that You create, all copyright, patent, or trademark notices from the +Source Code of the Original Work, as well as any notices of licensing and any +descriptive text identified therein as an "Attribution Notice." You must cause +the Source Code for any Derivative Works that You create to carry a prominent +Attribution Notice reasonably calculated to inform recipients that You have +modified the Original Work. + +7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that +the copyright in and to the Original Work and the patent rights granted herein +by Licensor are owned by the Licensor or are sublicensed to You under the +terms of this License with the permission of the contributor(s) of those +copyrights and patent rights. Except as expressly stated in the immediately +preceding sentence, the Original Work is provided under this License on an "AS +IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without +limitation, the warranties of non-infringement, merchantability or fitness for +a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK +IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this +License. No license to the Original Work is granted by this License except +under this disclaimer. + +8) Limitation of Liability. Under no circumstances and under no legal theory, +whether in tort (including negligence), contract, or otherwise, shall the +Licensor be liable to anyone for any indirect, special, incidental, or +consequential damages of any character arising as a result of this License or +the use of the Original Work including, without limitation, damages for loss +of goodwill, work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses. This limitation of liability shall not +apply to the extent applicable law prohibits such limitation. + +9) Acceptance and Termination. If, at any time, You expressly assented to this +License, that assent indicates your clear and irrevocable acceptance of this +License and all of its terms and conditions. If You distribute or communicate +copies of the Original Work or a Derivative Work, You must make a reasonable +effort under the circumstances to obtain the express assent of recipients to +the terms of this License. This License conditions your rights to undertake +the activities listed in Section 1, including your right to create Derivative +Works based upon the Original Work, and doing so without honoring these terms +and conditions is prohibited by copyright law and international treaty. +Nothing in this License is intended to affect copyright exceptions and +limitations (including "fair use" or "fair dealing"). This License shall +terminate immediately and You may no longer exercise any of the rights granted +to You by this License upon your failure to honor the conditions in Section +1(c). + +10) Termination for Patent Action. This License shall terminate automatically +and You may no longer exercise any of the rights granted to You by this +License as of the date You commence an action, including a cross-claim or +counterclaim, against Licensor or any licensee alleging that the Original Work +infringes a patent. This termination provision shall not apply for an action +alleging patent infringement by combinations of the Original Work with other +software or hardware. + +11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this +License may be brought only in the courts of a jurisdiction wherein the +Licensor resides or in which Licensor conducts its primary business, and under +the laws of that jurisdiction excluding its conflict-of-law provisions. The +application of the United Nations Convention on Contracts for the +International Sale of Goods is expressly excluded. Any use of the Original +Work outside the scope of this License or after its termination shall be +subject to the requirements and penalties of copyright or patent law in the +appropriate jurisdiction. This section shall survive the termination of this +License. + +12) Attorneys' Fees. In any action to enforce the terms of this License or +seeking damages relating thereto, the prevailing party shall be entitled to +recover its costs and expenses, including, without limitation, reasonable +attorneys' fees and costs incurred in connection with such action, including +any appeal of such action. This section shall survive the termination of this +License. + +13) Miscellaneous. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent necessary +to make it enforceable. + +14) Definition of "You" in This License. "You" throughout this License, +whether in upper or lower case, means an individual or a legal entity +exercising rights under, and complying with all of the terms of, this License. +For legal entities, "You" includes any entity that controls, is controlled by, +or is under common control with you. For purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the direction or +management of such entity, whether by contract or otherwise, or (ii) ownership +of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial +ownership of such entity. + +15) Right to Use. You may use the Original Work in all ways not otherwise +restricted or conditioned by this License or by law, and Licensor promises not +to interfere with or be responsible for such uses by You. + +16) Modification of This License. This License is Copyright © 2005 Lawrence +Rosen. Permission is granted to copy, distribute, or communicate this License +without modification. Nothing in this License permits You to modify this +License as applied to the Original Work or to Derivative Works. However, You +may modify the text of this License and copy, distribute or communicate your +modified version (the "Modified License") and apply it to other original works +of authorship subject to the following conditions: (i) You may not indicate in +any way that your Modified License is the "Open Software License" or "OSL" and +you may not use those names in the name of your Modified License; (ii) You +must replace the notice specified in the first paragraph above with the notice +"Licensed under <insert your license name here>" or with a notice of your own +that is not confusingly similar to the notice in this License; and (iii) You +may not claim that your original works are open source software unless your +Modified License has been approved by Open Source Initiative (OSI) and You +comply with its license review and certification process.
\ No newline at end of file diff --git a/license_afl.rst b/license_afl.rst new file mode 100644 index 000000000..ca39be9b6 --- /dev/null +++ b/license_afl.rst @@ -0,0 +1,245 @@ +################################### +Academic Free License ("AFL") v 3.0 +################################### + +This Academic Free License (the "License") applies to any original work of +authorship (the "Original Work") whose owner (the "Licensor") has placed the +following licensing notice adjacent to the copyright notice for the Original +Work: + +*Licensed under the Academic Free License version 3.0* + + +***************************** +1) Grant of Copyright License +***************************** + +Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable +license, for the duration of the copyright, to do the following: + + *a)* to reproduce the Original Work in copies, either alone or as part of + a collective work; + + *b)* to translate, adapt, alter, transform, modify, or arrange the + Original Work, thereby creating derivative works ("Derivative Works") + based upon the Original Work; + + *c)* to distribute or communicate copies of the Original Work and + Derivative Works to the public, *under any license of your choice that + does not contradict the terms and conditions, including Licensor's + reserved rights and remedies, in this Academic Free License*; + + *d)* to perform the Original Work publicly; and + + *e)* to display the Original Work publicly. + + +************************** +2) Grant of Patent License +************************** + +Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable +license, under patent claims owned or controlled by the Licensor that are +embodied in the Original Work as furnished by the Licensor, for the duration +of the patents, to make, use, sell, offer for sale, have made, and import the +Original Work and Derivative Works. + + +******************************* +3) Grant of Source Code License +******************************* + +The term "Source Code" means the preferred form of the Original Work for +making modifications to it and all available documentation describing how to +modify the Original Work. Licensor agrees to provide a machine-readable copy +of the Source Code of the Original Work along with each copy of the Original +Work that Licensor distributes. Licensor reserves the right to satisfy this +obligation by placing a machine-readable copy of the Source Code in an +information repository reasonably calculated to permit inexpensive and +convenient access by You for as long as Licensor continues to distribute the +Original Work. + + +******************************** +4) Exclusions From License Grant +******************************** + +Neither the names of Licensor, nor the names of any contributors to the +Original Work, nor any of their trademarks or service marks, may be used to +endorse or promote products derived from this Original Work without express +prior permission of the Licensor. Except as expressly stated herein, nothing +in this License grants any license to Licensor's trademarks, copyrights, +patents, trade secrets or any other intellectual property. No patent license +is granted to make, use, sell, offer for sale, have made, or import +embodiments of any patent claims other than the licensed claims defined in +Section 2) No license is granted to the trademarks of Licensor even if such +marks are included in the Original Work. Nothing in this License shall be +interpreted to prohibit Licensor from licensing under terms different from +this License any Original Work that Licensor otherwise would have a right to +license. + + +********************** +5) External Deployment +********************** + +The term "External Deployment" means the use, distribution, or communication +of the Original Work or Derivative Works in any way such that the Original +Work or Derivative Works may be used by anyone other than You, whether those +works are distributed or communicated to those persons or made available as an +application intended for use over a network. As an express condition for the +grants of license hereunder, You must treat any External Deployment by You of +the Original Work or a Derivative Work as a distribution under section 1(c). + + +********************* +6) Attribution Rights +********************* + +You must retain, in the Source Code of any Derivative Works that You create, +all copyright, patent, or trademark notices from the Source Code of the +Original Work, as well as any notices of licensing and any descriptive text +identified therein as an "Attribution Notice." You must cause the Source Code +for any Derivative Works that You create to carry a prominent Attribution +Notice reasonably calculated to inform recipients that You have modified the +Original Work. + + +**************************************************** +7) Warranty of Provenance and Disclaimer of Warranty +**************************************************** + +Licensor warrants that the copyright in and to the Original Work and the +patent rights granted herein by Licensor are owned by the Licensor or are +sublicensed to You under the terms of this License with the permission of the +contributor(s) of those copyrights and patent rights. Except as expressly +stated in the immediately preceding sentence, the Original Work is provided +under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or +implied, including, without limitation, the warranties of non-infringement, +merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE +QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY +constitutes an essential part of this License. No license to the Original Work +is granted by this License except under this disclaimer. + + +************************** +8) Limitation of Liability +************************** + +Under no circumstances and under no legal theory, whether in tort (including +negligence), contract, or otherwise, shall the Licensor be liable to anyone +for any indirect, special, incidental, or consequential damages of any +character arising as a result of this License or the use of the Original Work +including, without limitation, damages for loss of goodwill, work stoppage, +computer failure or malfunction, or any and all other commercial damages or +losses. This limitation of liability shall not apply to the extent applicable +law prohibits such limitation. + + +***************************** +9) Acceptance and Termination +***************************** + +If, at any time, You expressly assented to this License, that assent indicates +your clear and irrevocable acceptance of this License and all of its terms and +conditions. If You distribute or communicate copies of the Original Work or a +Derivative Work, You must make a reasonable effort under the circumstances to +obtain the express assent of recipients to the terms of this License. This +License conditions your rights to undertake the activities listed in Section +1, including your right to create Derivative Works based upon the Original +Work, and doing so without honoring these terms and conditions is prohibited +by copyright law and international treaty. Nothing in this License is intended +to affect copyright exceptions and limitations (including "fair use" or "fair +dealing"). This License shall terminate immediately and You may no longer +exercise any of the rights granted to You by this License upon your failure to +honor the conditions in Section 1(c). + + +********************************* +10) Termination for Patent Action +********************************* + +This License shall terminate automatically and You may no longer exercise any +of the rights granted to You by this License as of the date You commence an +action, including a cross-claim or counterclaim, against Licensor or any +licensee alleging that the Original Work infringes a patent. This termination +provision shall not apply for an action alleging patent infringement by +combinations of the Original Work with other software or hardware. + + +***************************************** +11) Jurisdiction, Venue and Governing Law +***************************************** + +Any action or suit relating to this License may be brought only in the courts +of a jurisdiction wherein the Licensor resides or in which Licensor conducts +its primary business, and under the laws of that jurisdiction excluding its +conflict-of-law provisions. The application of the United Nations Convention +on Contracts for the International Sale of Goods is expressly excluded. Any +use of the Original Work outside the scope of this License or after its +termination shall be subject to the requirements and penalties of copyright or +patent law in the appropriate jurisdiction. This section shall survive the +termination of this License. + + +******************* +12) Attorneys' Fees +******************* + +In any action to enforce the terms of this License or seeking damages relating +thereto, the prevailing party shall be entitled to recover its costs and +expenses, including, without limitation, reasonable attorneys' fees and costs +incurred in connection with such action, including any appeal of such action. +This section shall survive the termination of this License. + + +***************** +13) Miscellaneous +***************** + +If any provision of this License is held to be unenforceable, such provision +shall be reformed only to the extent necessary to make it enforceable. + + +*************************************** +14) Definition of "You" in This License +*************************************** + +"You" throughout this License, whether in upper or lower case, means an +individual or a legal entity exercising rights under, and complying with all +of the terms of, this License. For legal entities, "You" includes any entity +that controls, is controlled by, or is under common control with you. For +purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + + +**************** +15) Right to Use +**************** + +You may use the Original Work in all ways not otherwise restricted or +conditioned by this License or by law, and Licensor promises not to interfere +with or be responsible for such uses by You. + + +******************************** +16) Modification of This License +******************************** + +This License is Copyright © 2005 Lawrence Rosen. Permission is granted to +copy, distribute, or communicate this License without modification. Nothing in +this License permits You to modify this License as applied to the Original +Work or to Derivative Works. However, You may modify the text of this License +and copy, distribute or communicate your modified version (the "Modified +License") and apply it to other original works of authorship subject to the +following conditions: (i) You may not indicate in any way that your Modified +License is the "Academic Free License" or "AFL" and you may not use those +names in the name of your Modified License; (ii) You must replace the notice +specified in the first paragraph above with the notice "Licensed under <insert +your license name here>" or with a notice of your own that is not confusingly +similar to the notice in this License; and (iii) You may not claim that your +original works are open source software unless your Modified License has been +approved by Open Source Initiative (OSI) and You comply with its license +review and certification process.
\ No newline at end of file diff --git a/license_afl.txt b/license_afl.txt new file mode 100644 index 000000000..6fc164c1e --- /dev/null +++ b/license_afl.txt @@ -0,0 +1,172 @@ +Academic Free License ("AFL") v 3.0 + +This Academic Free License (the "License") applies to any original work of +authorship (the "Original Work") whose owner (the "Licensor") has placed the +following licensing notice adjacent to the copyright notice for the Original +Work: + +Licensed under the Academic Free License version 3.0 + +1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, +non-exclusive, sublicensable license, for the duration of the copyright, to do +the following: + + a) to reproduce the Original Work in copies, either alone or as part of a + collective work; + + b) to translate, adapt, alter, transform, modify, or arrange the Original + Work, thereby creating derivative works ("Derivative Works") based + upon the Original Work; + + c) to distribute or communicate copies of the Original Work and Derivative + Works to the public, under any license of your choice that does not + contradict the terms and conditions, including Licensor's reserved + rights and remedies, in this Academic Free License; + + d) to perform the Original Work publicly; and + + e) to display the Original Work publicly. + +2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, +non-exclusive, sublicensable license, under patent claims owned or controlled +by the Licensor that are embodied in the Original Work as furnished by the +Licensor, for the duration of the patents, to make, use, sell, offer for sale, +have made, and import the Original Work and Derivative Works. + +3) Grant of Source Code License. The term "Source Code" means the preferred +form of the Original Work for making modifications to it and all available +documentation describing how to modify the Original Work. Licensor agrees to +provide a machine-readable copy of the Source Code of the Original Work along +with each copy of the Original Work that Licensor distributes. Licensor +reserves the right to satisfy this obligation by placing a machine-readable +copy of the Source Code in an information repository reasonably calculated to +permit inexpensive and convenient access by You for as long as Licensor +continues to distribute the Original Work. + +4) Exclusions From License Grant. Neither the names of Licensor, nor the names +of any contributors to the Original Work, nor any of their trademarks or +service marks, may be used to endorse or promote products derived from this +Original Work without express prior permission of the Licensor. Except as +expressly stated herein, nothing in this License grants any license to +Licensor's trademarks, copyrights, patents, trade secrets or any other +intellectual property. No patent license is granted to make, use, sell, offer +for sale, have made, or import embodiments of any patent claims other than the +licensed claims defined in Section 2. No license is granted to the trademarks +of Licensor even if such marks are included in the Original Work. Nothing in +this License shall be interpreted to prohibit Licensor from licensing under +terms different from this License any Original Work that Licensor otherwise +would have a right to license. + +5) External Deployment. The term "External Deployment" means the use, +distribution, or communication of the Original Work or Derivative Works in any +way such that the Original Work or Derivative Works may be used by anyone +other than You, whether those works are distributed or communicated to those +persons or made available as an application intended for use over a network. +As an express condition for the grants of license hereunder, You must treat +any External Deployment by You of the Original Work or a Derivative Work as a +distribution under section 1(c). + +6) Attribution Rights. You must retain, in the Source Code of any Derivative +Works that You create, all copyright, patent, or trademark notices from the +Source Code of the Original Work, as well as any notices of licensing and any +descriptive text identified therein as an "Attribution Notice." You must cause +the Source Code for any Derivative Works that You create to carry a prominent +Attribution Notice reasonably calculated to inform recipients that You have +modified the Original Work. + +7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that +the copyright in and to the Original Work and the patent rights granted herein +by Licensor are owned by the Licensor or are sublicensed to You under the +terms of this License with the permission of the contributor(s) of those +copyrights and patent rights. Except as expressly stated in the immediately +preceding sentence, the Original Work is provided under this License on an "AS +IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without +limitation, the warranties of non-infringement, merchantability or fitness for +a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK +IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this +License. No license to the Original Work is granted by this License except +under this disclaimer. + +8) Limitation of Liability. Under no circumstances and under no legal theory, +whether in tort (including negligence), contract, or otherwise, shall the +Licensor be liable to anyone for any indirect, special, incidental, or +consequential damages of any character arising as a result of this License or +the use of the Original Work including, without limitation, damages for loss +of goodwill, work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses. This limitation of liability shall not +apply to the extent applicable law prohibits such limitation. + +9) Acceptance and Termination. If, at any time, You expressly assented to this +License, that assent indicates your clear and irrevocable acceptance of this +License and all of its terms and conditions. If You distribute or communicate +copies of the Original Work or a Derivative Work, You must make a reasonable +effort under the circumstances to obtain the express assent of recipients to +the terms of this License. This License conditions your rights to undertake +the activities listed in Section 1, including your right to create Derivative +Works based upon the Original Work, and doing so without honoring these terms +and conditions is prohibited by copyright law and international treaty. +Nothing in this License is intended to affect copyright exceptions and +limitations (including "fair use" or "fair dealing"). This License shall +terminate immediately and You may no longer exercise any of the rights granted +to You by this License upon your failure to honor the conditions in Section +1(c). + +10) Termination for Patent Action. This License shall terminate automatically +and You may no longer exercise any of the rights granted to You by this +License as of the date You commence an action, including a cross-claim or +counterclaim, against Licensor or any licensee alleging that the Original Work +infringes a patent. This termination provision shall not apply for an action +alleging patent infringement by combinations of the Original Work with other +software or hardware. + +11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this +License may be brought only in the courts of a jurisdiction wherein the +Licensor resides or in which Licensor conducts its primary business, and under +the laws of that jurisdiction excluding its conflict-of-law provisions. The +application of the United Nations Convention on Contracts for the +International Sale of Goods is expressly excluded. Any use of the Original +Work outside the scope of this License or after its termination shall be +subject to the requirements and penalties of copyright or patent law in the +appropriate jurisdiction. This section shall survive the termination of this +License. + +12) Attorneys' Fees. In any action to enforce the terms of this License or +seeking damages relating thereto, the prevailing party shall be entitled to +recover its costs and expenses, including, without limitation, reasonable +attorneys' fees and costs incurred in connection with such action, including +any appeal of such action. This section shall survive the termination of this +License. + +13) Miscellaneous. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent necessary +to make it enforceable. + +14) Definition of "You" in This License. "You" throughout this License, +whether in upper or lower case, means an individual or a legal entity +exercising rights under, and complying with all of the terms of, this License. +For legal entities, "You" includes any entity that controls, is controlled by, +or is under common control with you. For purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the direction or +management of such entity, whether by contract or otherwise, or (ii) ownership +of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial +ownership of such entity. + +15) Right to Use. You may use the Original Work in all ways not otherwise +restricted or conditioned by this License or by law, and Licensor promises not +to interfere with or be responsible for such uses by You. + +16) Modification of This License. This License is Copyright © 2005 Lawrence +Rosen. Permission is granted to copy, distribute, or communicate this License +without modification. Nothing in this License permits You to modify this +License as applied to the Original Work or to Derivative Works. However, You +may modify the text of this License and copy, distribute or communicate your +modified version (the "Modified License") and apply it to other original works +of authorship subject to the following conditions: (i) You may not indicate in +any way that your Modified License is the "Academic Free License" or "AFL" and +you may not use those names in the name of your Modified License; (ii) You +must replace the notice specified in the first paragraph above with the notice +"Licensed under <insert your license name here>" or with a notice of your own +that is not confusingly similar to the notice in this License; and (iii) You +may not claim that your original works are open source software unless your +Modified License has been approved by Open Source Initiative (OSI) and You +comply with its license review and certification process.
\ No newline at end of file diff --git a/readme.md b/readme.md deleted file mode 100644 index b6a88ea7a..000000000 --- a/readme.md +++ /dev/null @@ -1,99 +0,0 @@ -# What is CodeIgniter - -CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task. - -## Release Information - -This repo contains in development code for future releases. To download the latest stable release please visit the [CodeIgniter Downloads](http://codeigniter.com/downloads/) page. - -## Changelog and New Features - -You can find a list of all changes for each release in the [user guide](https://github.com/EllisLab/CodeIgniter/blob/develop/user_guide/changelog.html). - -## Server Requirements - -* PHP version 5.1.6 or newer. - -## Installation - -Please see the installation section of the [CodeIgniter User Guide](http://codeigniter.com/user_guide/installation/index.html) - -## Contributing - -CodeIgniter is a community driven project and accepts contributions of code and documentation from the community. These contributions are made in the form of Issues or [Pull Requests](http://help.github.com/send-pull-requests/) on the [EllisLab CodeIgniter repository](https://github.com/EllisLab/CodeIgniter) on GitHub. - -Issues are a quick way to point out a bug. If you find a bug or documentation error in CodeIgniter then please check a few things first: - - - There is not already an open Issue - The issue has already been fixed (check the develop branch, or look for closed Issues) - Is it something really obvious that you fix it yourself? - -Reporting issues is helpful but an even better approach is to send a Pull Request, which is done by “Forking” the main repository and committing to your own copy. This will require you to use the version control system called Git. - -Guidelines ----------- - -Before we look into how, here are the guidelines. If your Pull Requests fail to pass these guidelines it will be declined and you will need to re-submit when you’ve made the changes. This might sound a bit tough, but it is required for us to maintain quality of the code-base. - -PHP Style: All code must meet the [Style Guide](http://codeigniter.com/user_guide/general/styleguide.html), which is essentially the [Allman indent style](http://en.wikipedia.org/wiki/Indent_style#Allman_style), underscores and readable operators. This makes certain that all code is the same format as the existing code and means it will be as readable as possible. - -Documentation: If you change anything that requires a change to documentation then you will need to add it. New classes, methods, parameters, changing default values, etc are all things that will require a change to documentation. The change-log must also be updated for every change. Also PHPDoc blocks must be maintained. - -Compatibility: CodeIgniter is compatible with PHP 5.1.6 so all code supplied must stick to this requirement. If PHP 5.2 or 5.3 functions or features are used then there must be a fallback for PHP 5.1.6. - -Branching: CodeIgniter uses the [Git-Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model which requires all pull requests to be sent to the “develop” branch. This is where the next planned version will be developed. The “master” branch will always contain the latest stable version and is kept clean so a “hotfix” (e.g: an emergency security patch) can be applied to master to create a new version, without worrying about other features holding it up. For this reason all commits need to be made to “develop” and any sent to “master” will be closed automatically. If you have multiple changes to submit, please place all changes into their own branch on your fork. - -One thing at a time: A pull request should only contain one change. That does not mean only one commit, but one change - however many commits it took. The reason for this is that if you change X and Y but send a pull request for both at the same time, we might really want X but disagree with Y, meaning we cannot merge the request. Using the Git-Flow branching model you can create new branches for both of these features and send two requests. - -How-to Guide ------------- - -There are two ways to make changes, the easy way and the hard way. Either way you will need to [create a GitHub account](https://github.com/signup/free). - -Easy way -GitHub allows in-line editing of files for making simple typo changes and quick-fixes. This is not the best way as you are unable to test the code works. If you do this you could be introducing syntax errors, etc, but for a Git-phobic user this is good for a quick-fix. - -Hard way -The best way to contribute is to “clone” your fork of CodeIgniter to your development area. That sounds like some jargon, but “forking” on GitHub means “making a copy of that repo to your account” and “cloning” means “copying that code to your environment so you can work on it”. - - Set up Git (Windows, Mac & Linux) - Go to the CodeIgniter repo - Fork it - Clone your CodeIgniter repo: git@github.com:<your-name>/CodeIgniter.git - Checkout the “develop” branch At this point you are ready to start making changes. - Fix existing bugs on the Issue tracker after taking a look to see nobody else is working on them. - Commit the files - Push your develop branch to your fork - Send a pull request http://help.github.com/send-pull-requests/ - -The Reactor Engineers will now be alerted about the change and at least one of the team will respond. If your change fails to meet the guidelines it will be bounced, or feedback will be provided to help you improve it. - -Once the Reactor Engineer handling your pull request is happy with it they will post it to the internal EllisLab discussion area to be double checked by the other Engineers and EllisLab developers. If nobody has a problem with the change then it will be merged into develop and will be part of the next release. -Keeping your fork up-to-date - -Unlike systems like Subversion, Git can have multiple remotes. A remote is the name for a URL of a Git repository. By default your fork will have a remote named “origin” which points to your fork, but you can add another remote named “codeigniter” which points to git://github.com/EllisLab/CodeIgniter.git. This is a read-only remote but you can pull from this develop branch to update your own. - -If you are using command-line you can do the following: - - git remote add codeigniter git://github.com/EllisLab/CodeIgniter.git - git pull codeigniter develop - git push origin develop - -Now your fork is up to date. This should be done regularly, or before you send a pull request at least. - -## License - -Please see the [license agreement](http://codeigniter.com/user_guide/license.html) - -## Resources - - * [User Guide](http://codeigniter.com/user_guide/) - * [Community Forums](http://codeigniter.com/forums/) - * [User Voice](http://codeigniter.uservoice.com/forums/40508-codeigniter-reactor) - * [Community Wiki](http://codeigniter.com/wiki/) - * [Community IRC](http://codeigniter.com/irc/) - -## Acknowledgement - -The EllisLab team and The Reactor Engineers would like to thank all the contributors to the CodeIgniter project and you, the CodeIgniter user. diff --git a/readme.rst b/readme.rst new file mode 100644 index 000000000..26e04ceac --- /dev/null +++ b/readme.rst @@ -0,0 +1,196 @@ +################### +What is CodeIgniter +################### + +CodeIgniter is an Application Development Framework - a toolkit - for people +who build web sites using PHP. Its goal is to enable you to develop projects +much faster than you could if you were writing code from scratch, by providing +a rich set of libraries for commonly needed tasks, as well as a simple +interface and logical structure to access these libraries. CodeIgniter lets +you creatively focus on your project by minimizing the amount of code needed +for a given task. + +******************* +Release Information +******************* + +This repo contains in development code for future releases. To download the +latest stable release please visit the `CodeIgniter Downloads +<http://codeigniter.com/downloads/>`_ page. + +************************** +Changelog and New Features +************************** + +You can find a list of all changes for each release in the `user +guide change log <https://github.com/EllisLab/CodeIgniter/blob/develop/user_guide/changelog.html>`_. + +******************* +Server Requirements +******************* + +- PHP version 5.1.6 or newer. + +************ +Installation +************ + +Please see the `installation section <http://codeigniter.com/user_guide/installation/index.html>`_ +of the CodeIgniter User Guide. + +************ +Contributing +************ + +CodeIgniter is a community driven project and accepts contributions of code +and documentation from the community. These contributions are made in the form +of Issues or `Pull Requests <http://help.github.com/send-pull-requests/>`_ on +the `EllisLab CodeIgniter repository +<https://github.com/EllisLab/CodeIgniter>`_ on GitHub. + +Issues are a quick way to point out a bug. If you find a bug or documentation +error in CodeIgniter then please check a few things first: + +- There is not already an open Issue +- The issue has already been fixed (check the develop branch, or look for + closed Issues) +- Is it something really obvious that you fix it yourself? + +Reporting issues is helpful but an even better approach is to send a Pull +Request, which is done by "Forking" the main repository and committing to your +own copy. This will require you to use the version control system called Git. + +********** +Guidelines +********** + +Before we look into how, here are the guidelines. If your Pull Requests fail +to pass these guidelines it will be declined and you will need to re-submit +when you’ve made the changes. This might sound a bit tough, but it is required +for us to maintain quality of the code-base. + +PHP Style +========= + +All code must meet the `Style Guide +<http://codeigniter.com/user_guide/general/styleguide.html>`_, which is +essentially the `Allman indent style +<http://en.wikipedia.org/wiki/Indent_style#Allman_style>`_, underscores and +readable operators. This makes certain that all code is the same format as the +existing code and means it will be as readable as possible. + +Documentation +============= + +If you change anything that requires a change to documentation then you will +need to add it. New classes, methods, parameters, changing default values, etc +are all things that will require a change to documentation. The change-log +must also be updated for every change. Also PHPDoc blocks must be maintained. + +Compatibility +============= + +CodeIgniter is compatible with PHP 5.1.6 so all code supplied must stick to +this requirement. If PHP 5.2 or 5.3 functions or features are used then there +must be a fallback for PHP 5.1.6. + +Branching +========= + +CodeIgniter uses the `Git-Flow +<http://nvie.com/posts/a-successful-git-branching-model/>`_ branching model +which requires all pull requests to be sent to the "develop" branch. This is +where the next planned version will be developed. The "master" branch will +always contain the latest stable version and is kept clean so a "hotfix" (e.g: +an emergency security patch) can be applied to master to create a new version, +without worrying about other features holding it up. For this reason all +commits need to be made to "develop" and any sent to "master" will be closed +automatically. If you have multiple changes to submit, please place all +changes into their own branch on your fork. + +One thing at a time: A pull request should only contain one change. That does +not mean only one commit, but one change - however many commits it took. The +reason for this is that if you change X and Y but send a pull request for both +at the same time, we might really want X but disagree with Y, meaning we +cannot merge the request. Using the Git-Flow branching model you can create +new branches for both of these features and send two requests. + +************ +How-to Guide +************ + +There are two ways to make changes, the easy way and the hard way. Either way +you will need to `create a GitHub account <https://github.com/signup/free>`_. + +Easy way GitHub allows in-line editing of files for making simple typo changes +and quick-fixes. This is not the best way as you are unable to test the code +works. If you do this you could be introducing syntax errors, etc, but for a +Git-phobic user this is good for a quick-fix. + +Hard way The best way to contribute is to "clone" your fork of CodeIgniter to +your development area. That sounds like some jargon, but "forking" on GitHub +means "making a copy of that repo to your account" and "cloning" means +"copying that code to your environment so you can work on it". + +#. Set up Git (Windows, Mac & Linux) +#. Go to the CodeIgniter repo +#. Fork it +#. Clone your CodeIgniter repo: git@github.com:<your-name>/CodeIgniter.git +#. Checkout the "develop" branch At this point you are ready to start making + changes. +#. Fix existing bugs on the Issue tracker after taking a look to see nobody + else is working on them. +#. Commit the files +#. Push your develop branch to your fork +#. Send a pull request http://help.github.com/send-pull-requests/ + +The Reactor Engineers will now be alerted about the change and at least one of +the team will respond. If your change fails to meet the guidelines it will be +bounced, or feedback will be provided to help you improve it. + +Once the Reactor Engineer handling your pull request is happy with it they +will post it to the internal EllisLab discussion area to be double checked by +the other Engineers and EllisLab developers. If nobody has a problem with the +change then it will be merged into develop and will be part of the next +release. Keeping your fork up-to-date + +Unlike systems like Subversion, Git can have multiple remotes. A remote is the +name for a URL of a Git repository. By default your fork will have a remote +named "origin" which points to your fork, but you can add another remote named +"codeigniter" which points to git://github.com/EllisLab/CodeIgniter.git. This +is a read-only remote but you can pull from this develop branch to update your +own. + +If you are using command-line you can do the following: + +#. git remote add codeigniter git://github.com/EllisLab/CodeIgniter.git +#. git pull codeigniter develop +#. git push origin develop + +Now your fork is up to date. This should be done regularly, or before you send +a pull request at least. + +******* +License +******* + +Please see the `license +agreement <http://codeigniter.com/user_guide/license.html>`_ + +********* +Resources +********* + +- `User Guide <http://codeigniter.com/user_guide/>`_ +- `Community Forums <http://codeigniter.com/forums/>`_ +- `User + Voice <http://codeigniter.uservoice.com/forums/40508-codeigniter-reactor>`_ +- `Community Wiki <http://codeigniter.com/wiki/>`_ +- `Community IRC <http://codeigniter.com/irc/>`_ + +*************** +Acknowledgement +*************** + +The EllisLab team and The Reactor Engineers would like to thank all the +contributors to the CodeIgniter project and you, the CodeIgniter user.
\ No newline at end of file diff --git a/system/core/Benchmark.php b/system/core/Benchmark.php index a200727ab..0f3104079 100755 --- a/system/core/Benchmark.php +++ b/system/core/Benchmark.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -24,7 +36,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/benchmark.html */ class CI_Benchmark { diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 9f88384b1..97527e5ca 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage codeigniter * @category Front-controller - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/ */ @@ -33,7 +45,7 @@ * @var string * */ - define('CI_VERSION', '2.1.0-dev'); + define('CI_VERSION', '3.0-dev'); /* * ------------------------------------------------------ @@ -94,9 +106,13 @@ * Set a liberal script execution time limit * ------------------------------------------------------ */ - if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0) + if (function_exists("set_time_limit") AND @ini_get("safe_mode") == 0) { - @set_time_limit(300); + // Do not override the Time Limit value if running from Command Line + if(php_sapi_name() != 'cli') + { + @set_time_limit(300); + } } /* diff --git a/system/core/Common.php b/system/core/Common.php index d79375475..b0921fe0c 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage codeigniter * @category Common Functions - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/ */ @@ -407,6 +419,7 @@ if ( ! function_exists('set_status_header')) 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', + 422 => 'Unprocessable Entity', 500 => 'Internal Server Error', 501 => 'Not Implemented', diff --git a/system/core/Config.php b/system/core/Config.php index 714c4667b..b0b4c9aa4 100755 --- a/system/core/Config.php +++ b/system/core/Config.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/config.html */ class CI_Config { @@ -316,7 +328,7 @@ class CI_Config { $uri = $str; } } - return $uri; + return $uri; } // -------------------------------------------------------------------- diff --git a/system/core/Controller.php b/system/core/Controller.php index fddb81e19..ca2bf41b5 100644 --- a/system/core/Controller.php +++ b/system/core/Controller.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -24,7 +36,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/general/controllers.html */ class CI_Controller { diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php index 869739a5a..ead8d814e 100755 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Exceptions - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/exceptions.html */ class CI_Exceptions { diff --git a/system/core/Hooks.php b/system/core/Hooks.php index 33f1c034c..aa251a389 100755 --- a/system/core/Hooks.php +++ b/system/core/Hooks.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/encryption.html */ class CI_Hooks { @@ -82,7 +94,7 @@ class CI_Hooks { if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); + include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); } elseif (is_file(APPPATH.'config/hooks.php')) { diff --git a/system/core/Input.php b/system/core/Input.php index 6f8442107..3cbbe787f 100755 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Input - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/input.html */ class CI_Input { @@ -554,8 +566,12 @@ class CI_Input { return $new_array; } - // We strip slashes if magic quotes is on to keep things consistent - if (function_exists('get_magic_quotes_gpc') AND @get_magic_quotes_gpc()) + /* We strip slashes if magic quotes is on to keep things consistent + + NOTE: In PHP 5.4 get_magic_quotes_gpc() will always return 0 and + it will probably not exist in future versions at all. + */ + if ( ! is_php('5.4') && get_magic_quotes_gpc()) { $str = stripslashes($str); } @@ -724,7 +740,6 @@ class CI_Input { } } -// END Input class /* End of file Input.php */ /* Location: ./system/core/Input.php */ diff --git a/system/core/Lang.php b/system/core/Lang.php index d61d1029a..e03afb07d 100755 --- a/system/core/Lang.php +++ b/system/core/Lang.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Language - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/language.html */ class CI_Lang { diff --git a/system/core/Loader.php b/system/core/Loader.php index de0fc06d2..4e14b54af 100755..100644 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -22,7 +34,7 @@ * * @package CodeIgniter * @subpackage Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @category Loader * @link http://codeigniter.com/user_guide/libraries/loader.html */ @@ -616,6 +628,11 @@ class CI_Loader { require BASEPATH.'libraries/Driver.php'; } + if ($library == '') + { + return FALSE; + } + // We can save the loader some time since Drivers will *always* be in a subfolder, // and typically identically named to the library if ( ! strpos($library, '/')) diff --git a/system/core/Model.php b/system/core/Model.php index e15ffbebc..c34bab64b 100755 --- a/system/core/Model.php +++ b/system/core/Model.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/config.html */ class CI_Model { diff --git a/system/core/Output.php b/system/core/Output.php index ccecafd2b..9727a184f 100755 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Output - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/output.html */ class CI_Output { @@ -96,7 +108,7 @@ class CI_Output { // Get mime types for later if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { - include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; + include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; } else { diff --git a/system/core/Router.php b/system/core/Router.php index 6da667472..748678d67 100755 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -22,7 +34,7 @@ * * @package CodeIgniter * @subpackage Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @category Libraries * @link http://codeigniter.com/user_guide/general/routing.html */ diff --git a/system/core/Security.php b/system/core/Security.php index 65338ced3..60a64f358 100755 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Security - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/security.html */ class CI_Security { @@ -83,7 +95,8 @@ class CI_Security { '-moz-binding' => '[removed]', '<!--' => '<!--', '-->' => '-->', - '<![CDATA[' => '<![CDATA[' + '<![CDATA[' => '<![CDATA[', + '<comment>' => '<comment>' ); /** @@ -169,7 +182,7 @@ class CI_Security { // Nothing should last forever unset($_COOKIE[$this->_csrf_cookie_name]); - $this->_csrf_hash = ''; + $this->_csrf_hash = ''; $this->_csrf_set_hash(); $this->csrf_set_cookie(); @@ -486,15 +499,7 @@ class CI_Security { { if ($this->_xss_hash == '') { - if (phpversion() >= 4.2) - { - mt_srand(); - } - else - { - mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff); - } - + mt_srand(); $this->_xss_hash = md5(time() + mt_rand(0, 1999999999)); } @@ -508,6 +513,12 @@ class CI_Security { * * This function is a replacement for html_entity_decode() * + * The reason we are not using html_entity_decode() by itself is because + * while it is not technically correct to leave out the semicolon + * at the end of an entity most browsers will still interpret the entity + * correctly. html_entity_decode() does not convert entities without + * semicolons, so we are left with our own little solution here. Bummer. + * * @param string * @param string * @return string @@ -524,11 +535,6 @@ class CI_Security { $charset = config_item('charset'); } - // The reason we are not using html_entity_decode() by itself is because - // while it is not technically correct to leave out the semicolon - // at the end of an entity most browsers will still interpret the entity - // correctly. html_entity_decode() does not convert entities without - // semicolons, so we are left with our own little solution here. Bummer. $str = html_entity_decode($str, ENT_COMPAT, $charset); $str = preg_replace('~&#x(0*[0-9a-f]{2,5})~ei', 'chr(hexdec("\\1"))', $str); return preg_replace('~&#([0-9]{2,4})~e', 'chr(\\1)', $str); @@ -625,25 +631,45 @@ class CI_Security { protected function _remove_evil_attributes($str, $is_image) { // All javascript event handlers (e.g. onload, onclick, onmouseover), style, and xmlns - $evil_attributes = array('on\w*', 'style', 'xmlns'); + $evil_attributes = array('on\w*', 'style', 'xmlns', 'formaction'); if ($is_image === TRUE) { /* - * Adobe Photoshop puts XML metadata into JFIF images, + * Adobe Photoshop puts XML metadata into JFIF images, * including namespacing, so we have to allow this for images. */ unset($evil_attributes[array_search('xmlns', $evil_attributes)]); } - + do { - $str = preg_replace( - "#<(/?[^><]+?)([^A-Za-z\-])(".implode('|', $evil_attributes).")(\s*=\s*)([\"][^>]*?[\"]|[\'][^>]*?[\']|[^>]*?)([\s><])([><]*)#i", - "<$1$6", - $str, -1, $count - ); - } while ($count); + $count = 0; + $attribs = array(); + + // find occurrences of illegal attribute strings without quotes + preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*([^\s]*)/is", $str, $matches, PREG_SET_ORDER); + + foreach ($matches as $attr) + { + $attribs[] = preg_quote($attr[0], '/'); + } + + // find occurrences of illegal attribute strings with quotes (042 and 047 are octal quotes) + preg_match_all("/(".implode('|', $evil_attributes).")\s*=\s*(\042|\047)([^\\2]*?)(\\2)/is", $str, $matches, PREG_SET_ORDER); + foreach ($matches as $attr) + { + $attribs[] = preg_quote($attr[0], '/'); + } + + // replace illegal attribute strings that are inside an html tag + if (count($attribs) > 0) + { + $str = preg_replace("/<(\/?[^><]+?)([^A-Za-z\-])(".implode('|', $attribs).")([\s><])([><]*)/i", '<$1$2$4$5', $str, -1, $count); + } + + } while ($count); + return $str; } @@ -865,4 +891,4 @@ class CI_Security { } /* End of file Security.php */ -/* Location: ./system/core/Security.php */ +/* Location: ./system/core/Security.php */
\ No newline at end of file diff --git a/system/core/URI.php b/system/core/URI.php index 8946bc76b..578d17429 100755 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage Libraries * @category URI - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/uri.html */ class CI_URI { diff --git a/system/core/Utf8.php b/system/core/Utf8.php index 2a27d1f35..7abe4e43b 100644 --- a/system/core/Utf8.php +++ b/system/core/Utf8.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage Libraries * @category UTF-8 - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/utf8.html */ class CI_Utf8 { diff --git a/system/database/DB.php b/system/database/DB.php index 8314d3b97..5c90f44f3 100755 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * Initialize the database * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ * @param string * @param bool Determines if active record should be used or not diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 83518232e..530b44e09 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,44 +35,47 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_active_record extends CI_DB_driver { - var $ar_select = array(); - var $ar_distinct = FALSE; - var $ar_from = array(); - var $ar_join = array(); - var $ar_where = array(); - var $ar_like = array(); - var $ar_groupby = array(); - var $ar_having = array(); - var $ar_keys = array(); - var $ar_limit = FALSE; - var $ar_offset = FALSE; - var $ar_order = FALSE; - var $ar_orderby = array(); - var $ar_set = array(); - var $ar_wherein = array(); - var $ar_aliased_tables = array(); - var $ar_store_array = array(); + protected $return_delete_sql = FALSE; + protected $reset_delete_data = FALSE; + + protected $ar_select = array(); + protected $ar_distinct = FALSE; + protected $ar_from = array(); + protected $ar_join = array(); + protected $ar_where = array(); + protected $ar_like = array(); + protected $ar_groupby = array(); + protected $ar_having = array(); + protected $ar_keys = array(); + protected $ar_limit = FALSE; + protected $ar_offset = FALSE; + protected $ar_order = FALSE; + protected $ar_orderby = array(); + protected $ar_set = array(); + protected $ar_wherein = array(); + protected $ar_aliased_tables = array(); + protected $ar_store_array = array(); // Active Record Caching variables - var $ar_caching = FALSE; - var $ar_cache_exists = array(); - var $ar_cache_select = array(); - var $ar_cache_from = array(); - var $ar_cache_join = array(); - var $ar_cache_where = array(); - var $ar_cache_like = array(); - var $ar_cache_groupby = array(); - var $ar_cache_having = array(); - var $ar_cache_orderby = array(); - var $ar_cache_set = array(); + protected $ar_caching = FALSE; + protected $ar_cache_exists = array(); + protected $ar_cache_select = array(); + protected $ar_cache_from = array(); + protected $ar_cache_join = array(); + protected $ar_cache_where = array(); + protected $ar_cache_like = array(); + protected $ar_cache_groupby = array(); + protected $ar_cache_having = array(); + protected $ar_cache_orderby = array(); + protected $ar_cache_set = array(); - var $ar_no_escape = array(); - var $ar_cache_no_escape = array(); + protected $ar_no_escape = array(); + protected $ar_cache_no_escape = array(); // -------------------------------------------------------------------- @@ -660,7 +675,7 @@ class CI_DB_active_record extends CI_DB_driver { $prefix = (count($this->ar_like) == 0) ? '' : $type; $v = $this->escape_like_str($v); - + if ($side == 'none') { $like_statement = $prefix." $k $not LIKE '{$v}'"; @@ -815,9 +830,10 @@ class CI_DB_active_record extends CI_DB_driver { * * @param string * @param string direction: asc or desc + * @param bool enable field name escaping * @return object */ - public function order_by($orderby, $direction = '') + public function order_by($orderby, $direction = '', $escape = TRUE) { if (strtolower($direction) == 'random') { @@ -830,7 +846,7 @@ class CI_DB_active_record extends CI_DB_driver { } - if (strpos($orderby, ',') !== FALSE) + if ((strpos($orderby, ',') !== FALSE) && ($escape === TRUE)) { $temp = array(); foreach (explode(',', $orderby) as $part) @@ -848,7 +864,10 @@ class CI_DB_active_record extends CI_DB_driver { } else if ($direction != $this->_random_keyword) { - $orderby = $this->_protect_identifiers($orderby); + if ($escape === TRUE) + { + $orderby = $this->_protect_identifiers($orderby); + } } $orderby_statement = $orderby.$direction; @@ -931,7 +950,37 @@ class CI_DB_active_record extends CI_DB_driver { return $this; } + + // -------------------------------------------------------------------- + /** + * Get SELECT query string + * + * Compiles a SELECT query string and returns the sql. + * + * @access public + * @param string the table name to select from (optional) + * @param boolean TRUE: resets AR values; FALSE: leave AR vaules alone + * @return string + */ + public function get_compiled_select($table = '', $reset = TRUE) + { + if ($table != '') + { + $this->_track_aliases($table); + $this->from($table); + } + + $select = $this->_compile_select(); + + if ($reset === TRUE) + { + $this->_reset_select(); + } + + return $select; + } + // -------------------------------------------------------------------- /** @@ -1148,6 +1197,41 @@ class CI_DB_active_record extends CI_DB_driver { return $this; } + + // -------------------------------------------------------------------- + + /** + * Get INSERT query string + * + * Compiles an insert query and returns the sql + * + * @access public + * @param string the table to insert into + * @param boolean TRUE: reset AR values; FALSE: leave AR values alone + * @return string + */ + public function get_compiled_insert($table = '', $reset = TRUE) + { + if ($this->_validate_insert($table) === FALSE) + { + return FALSE; + } + + $sql = $this->_insert( + $this->_protect_identifiers( + $this->ar_from[0], TRUE, NULL, FALSE + ), + array_keys($this->ar_set), + array_values($this->ar_set) + ); + + if ($reset === TRUE) + { + $this->_reset_write(); + } + + return $sql; + } // -------------------------------------------------------------------- @@ -1156,17 +1240,50 @@ class CI_DB_active_record extends CI_DB_driver { * * Compiles an insert string and runs the query * + * @access public * @param string the table to insert data into * @param array an associative array of insert values * @return object */ - function insert($table = '', $set = NULL) + public function insert($table = '', $set = NULL) { if ( ! is_null($set)) { $this->set($set); } + + if ($this->_validate_insert($table) === FALSE) + { + return FALSE; + } + + $sql = $this->_insert( + $this->_protect_identifiers( + $this->ar_from[0], TRUE, NULL, FALSE + ), + array_keys($this->ar_set), + array_values($this->ar_set) + ); + + $this->_reset_write(); + return $this->query($sql); + } + + // -------------------------------------------------------------------- + /** + * Validate Insert + * + * This method is used by both insert() and get_compiled_insert() to + * validate that the there data is actually being set and that table + * has been chosen to be inserted into. + * + * @access public + * @param string the table to insert data into + * @return string + */ + protected function _validate_insert($table = '') + { if (count($this->ar_set) == 0) { if ($this->db_debug) @@ -1186,14 +1303,13 @@ class CI_DB_active_record extends CI_DB_driver { } return FALSE; } - - $table = $this->ar_from[0]; } - - $sql = $this->_insert($this->_protect_identifiers($table, TRUE, NULL, FALSE), array_keys($this->ar_set), array_values($this->ar_set)); - - $this->_reset_write(); - return $this->query($sql); + else + { + $this->ar_from[0] = $table; + } + + return TRUE; } // -------------------------------------------------------------------- @@ -1242,7 +1358,39 @@ class CI_DB_active_record extends CI_DB_driver { $this->_reset_write(); return $this->query($sql); } + + // -------------------------------------------------------------------- + /** + * Get UPDATE query string + * + * Compiles an update query and returns the sql + * + * @access public + * @param string the table to update + * @param boolean TRUE: reset AR values; FALSE: leave AR values alone + * @return string + */ + public function get_compiled_update($table = '', $reset = TRUE) + { + // Combine any cached components with the current statements + $this->_merge_cache(); + + if ($this->_validate_update($table) === FALSE) + { + return FALSE; + } + + $sql = $this->_update($this->_protect_identifiers($this->ar_from[0], TRUE, NULL, FALSE), $this->ar_set, $this->ar_where, $this->ar_orderby, $this->ar_limit); + + if ($reset === TRUE) + { + $this->_reset_write(); + } + + return $sql; + } + // -------------------------------------------------------------------- /** @@ -1265,6 +1413,42 @@ class CI_DB_active_record extends CI_DB_driver { $this->set($set); } + if ($this->_validate_update($table) === FALSE) + { + return FALSE; + } + + if ($where != NULL) + { + $this->where($where); + } + + if ($limit != NULL) + { + $this->limit($limit); + } + + $sql = $this->_update($this->_protect_identifiers($this->ar_from[0], TRUE, NULL, FALSE), $this->ar_set, $this->ar_where, $this->ar_orderby, $this->ar_limit, $this->ar_like); + + $this->_reset_write(); + return $this->query($sql); + } + + // -------------------------------------------------------------------- + + /** + * Validate Update + * + * This method is used by both update() and get_compiled_update() to + * validate that data is actually being set and that a table has been + * chosen to be update. + * + * @access public + * @param string the table to update data on + * @return string + */ + protected function _validate_update($table = '') + { if (count($this->ar_set) == 0) { if ($this->db_debug) @@ -1284,27 +1468,13 @@ class CI_DB_active_record extends CI_DB_driver { } return FALSE; } - - $table = $this->ar_from[0]; - } - - if ($where != NULL) - { - $this->where($where); } - - if ($limit != NULL) + else { - $this->limit($limit); + $this->ar_from[0] = $table; } - - $sql = $this->_update($this->_protect_identifiers($table, TRUE, NULL, FALSE), $this->ar_set, $this->ar_where, $this->ar_orderby, $this->ar_limit); - - $this->_reset_write(); - return $this->query($sql); } - - + // -------------------------------------------------------------------- /** @@ -1503,7 +1673,27 @@ class CI_DB_active_record extends CI_DB_driver { return $this->query($sql); } + + // -------------------------------------------------------------------- + /** + * Get DELETE query string + * + * Compiles a delete query string and returns the sql + * + * @access public + * @param string the table to delete from + * @param boolean TRUE: reset AR values; FALSE: leave AR values alone + * @return string + */ + public function get_compiled_delete($table = '', $reset = TRUE) + { + $this->return_delete_sql = TRUE; + $sql = $this->delete($table, '', NULL, $reset); + $this->return_delete_sql = FALSE; + return $sql; + } + // -------------------------------------------------------------------- /** @@ -1576,10 +1766,15 @@ class CI_DB_active_record extends CI_DB_driver { { $this->_reset_write(); } + + if ($this->return_delete_sql === true) + { + return $sql; + } return $this->query($sql); } - + // -------------------------------------------------------------------- /** @@ -1659,7 +1854,7 @@ class CI_DB_active_record extends CI_DB_driver { } } } - + // -------------------------------------------------------------------- /** @@ -1965,6 +2160,22 @@ class CI_DB_active_record extends CI_DB_driver { $this->ar_no_escape = $this->ar_cache_no_escape; } + + // -------------------------------------------------------------------- + + /** + * Reset Active Record values. + * + * Publicly-visible method to reset the AR values. + * + * @access public + * @return void + */ + public function reset_query() + { + $this->_reset_select(); + $this->_reset_write(); + } // -------------------------------------------------------------------- diff --git a/system/database/DB_cache.php b/system/database/DB_cache.php index ad1c28d72..6c1ffc0f3 100644 --- a/system/database/DB_cache.php +++ b/system/database/DB_cache.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * Database Cache Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_Cache { diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index d7b63b9dc..9d92f2f87 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -25,7 +37,7 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_driver { @@ -114,16 +126,43 @@ class CI_DB_driver { // Connect to the database and set the connection ID $this->conn_id = ($this->pconnect == FALSE) ? $this->db_connect() : $this->db_pconnect(); - // No connection resource? Throw an error + // No connection resource? Check if there is a failover else throw an error if ( ! $this->conn_id) { - log_message('error', 'Unable to connect to the database'); + // Check if there is a failover set + if ( ! empty($this->failover) && is_array($this->failover)) + { + // Go over all the failovers + foreach ($this->failover as $failover) + { + // Replace the current settings with those of the failover + foreach ($failover as $key => $val) + { + $this->$key = $val; + } - if ($this->db_debug) + // Try to connect + $this->conn_id = ($this->pconnect == FALSE) ? $this->db_connect() : $this->db_pconnect(); + + // If a connection is made break the foreach loop + if ($this->conn_id) + { + break; + } + } + } + + // We still don't have a connection? + if ( ! $this->conn_id) { - $this->display_error('db_unable_to_connect'); + log_message('error', 'Unable to connect to the database'); + + if ($this->db_debug) + { + $this->display_error('db_unable_to_connect'); + } + return FALSE; } - return FALSE; } // ---------------------------------------------------------------- @@ -510,6 +549,7 @@ class CI_DB_driver { } $this->trans_begin($test_mode); + $this->_trans_depth += 1; } // -------------------------------------------------------------------- @@ -533,6 +573,10 @@ class CI_DB_driver { $this->_trans_depth -= 1; return TRUE; } + else + { + $this->_trans_depth = 0; + } // The query() function will set this flag to FALSE in the event that a query failed if ($this->_trans_status === FALSE) @@ -1020,7 +1064,14 @@ class CI_DB_driver { { $args = (func_num_args() > 1) ? array_splice(func_get_args(), 1) : null; - return call_user_func_array($function, $args); + if (is_null($args)) + { + return call_user_func($function); + } + else + { + return call_user_func_array($function, $args); + } } } diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index 6bc40411b..78bf77a9f 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -1,13 +1,25 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** - * Code Igniter + * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * Database Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_forge { @@ -193,6 +205,12 @@ class CI_DB_forge { $sql = $this->_create_table($this->db->dbprefix.$table, $this->fields, $this->primary_keys, $this->keys, $if_not_exists); $this->_reset(); + + if (is_bool($sql)) + { + return $sql; + } + return $this->db->query($sql); } diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 0c4e78105..9f0b0187c 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * class for the specific database will extend and instantiate it. * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_result { @@ -45,7 +57,7 @@ class CI_DB_result { * @param string can be "object" or "array" * @return mixed either a result object or array */ - function result($type = 'object') + public function result($type = 'object') { if ($type == 'array') return $this->result_array(); else if ($type == 'object') return $this->result_object(); @@ -60,7 +72,7 @@ class CI_DB_result { * @param class_name A string that represents the type of object you want back * @return array of objects */ - function custom_result_object($class_name) + public function custom_result_object($class_name) { if (array_key_exists($class_name, $this->custom_result_object)) { @@ -79,12 +91,12 @@ class CI_DB_result { while ($row = $this->_fetch_object()) { $object = new $class_name(); - + foreach ($row as $key => $value) { $object->$key = $value; } - + $result_object[] = $object; } @@ -100,7 +112,7 @@ class CI_DB_result { * @access public * @return object */ - function result_object() + public function result_object() { if (count($this->result_object) > 0) { @@ -132,7 +144,7 @@ class CI_DB_result { * @access public * @return array */ - function result_array() + public function result_array() { if (count($this->result_array) > 0) { @@ -166,7 +178,7 @@ class CI_DB_result { * @param string can be "object" or "array" * @return mixed either a result object or array */ - function row($n = 0, $type = 'object') + public function row($n = 0, $type = 'object') { if ( ! is_numeric($n)) { @@ -198,7 +210,7 @@ class CI_DB_result { * @access public * @return object */ - function set_row($key, $value = NULL) + public function set_row($key, $value = NULL) { // We cache the row data for subsequent uses if ( ! is_array($this->row_data)) @@ -230,7 +242,7 @@ class CI_DB_result { * @access public * @return object */ - function custom_row_object($n, $type) + public function custom_row_object($n, $type) { $result = $this->custom_result_object($type); @@ -253,7 +265,7 @@ class CI_DB_result { * @access public * @return object */ - function row_object($n = 0) + public function row_object($n = 0) { $result = $this->result_object(); @@ -278,7 +290,7 @@ class CI_DB_result { * @access public * @return array */ - function row_array($n = 0) + public function row_array($n = 0) { $result = $this->result_array(); @@ -304,7 +316,7 @@ class CI_DB_result { * @access public * @return object */ - function first_row($type = 'object') + public function first_row($type = 'object') { $result = $this->result($type); @@ -323,7 +335,7 @@ class CI_DB_result { * @access public * @return object */ - function last_row($type = 'object') + public function last_row($type = 'object') { $result = $this->result($type); @@ -342,7 +354,7 @@ class CI_DB_result { * @access public * @return object */ - function next_row($type = 'object') + public function next_row($type = 'object') { $result = $this->result($type); @@ -367,7 +379,7 @@ class CI_DB_result { * @access public * @return object */ - function previous_row($type = 'object') + public function previous_row($type = 'object') { $result = $this->result($type); @@ -394,14 +406,14 @@ class CI_DB_result { * operational due to the unavailability of the database resource IDs with * cached results. */ - function num_rows() { return $this->num_rows; } - function num_fields() { return 0; } - function list_fields() { return array(); } - function field_data() { return array(); } - function free_result() { return TRUE; } - function _data_seek() { return TRUE; } - function _fetch_assoc() { return array(); } - function _fetch_object() { return array(); } + public function num_rows() { return $this->num_rows; } + public function num_fields() { return 0; } + public function list_fields() { return array(); } + public function field_data() { return array(); } + public function free_result() { return TRUE; } + protected function _data_seek() { return TRUE; } + protected function _fetch_assoc() { return array(); } + protected function _fetch_object() { return array(); } } // END DB_result class diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php index 52196b7ce..60ecb5269 100644 --- a/system/database/DB_utility.php +++ b/system/database/DB_utility.php @@ -1,13 +1,25 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** - * Code Igniter + * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * Database Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_utility extends CI_DB_forge { diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php index d01140412..8181bd605 100644 --- a/system/database/drivers/cubrid/cubrid_driver.php +++ b/system/database/drivers/cubrid/cubrid_driver.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author Esen Sagynov - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.0.2 * @filesource diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index bab03f748..410d0652c 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author Esen Sagynov - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource diff --git a/system/database/drivers/cubrid/cubrid_result.php b/system/database/drivers/cubrid/cubrid_result.php index 6f0c2b5f7..b2f1bcf71 100644 --- a/system/database/drivers/cubrid/cubrid_result.php +++ b/system/database/drivers/cubrid/cubrid_result.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author Esen Sagynov - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.0.2 * @filesource diff --git a/system/database/drivers/cubrid/cubrid_utility.php b/system/database/drivers/cubrid/cubrid_utility.php index cd16d1e18..1fa0390a8 100644 --- a/system/database/drivers/cubrid/cubrid_utility.php +++ b/system/database/drivers/cubrid/cubrid_utility.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author Esen Sagynov - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource diff --git a/system/database/drivers/mssql/mssql_driver.php b/system/database/drivers/mssql/mssql_driver.php index b39bd9360..87e7c9d37 100644 --- a/system/database/drivers/mssql/mssql_driver.php +++ b/system/database/drivers/mssql/mssql_driver.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -25,7 +37,7 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mssql_driver extends CI_DB { diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php index 70b20ecf8..0a893f68f 100644 --- a/system/database/drivers/mssql/mssql_forge.php +++ b/system/database/drivers/mssql/mssql_forge.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * MS SQL Forge Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mssql_forge extends CI_DB_forge { diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php index 2897ca5a5..a8cd7c982 100644 --- a/system/database/drivers/mssql/mssql_result.php +++ b/system/database/drivers/mssql/mssql_result.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * This class extends the parent result class: CI_DB_result * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mssql_result extends CI_DB_result { diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php index 48ecbc72a..576d13f86 100644 --- a/system/database/drivers/mssql/mssql_utility.php +++ b/system/database/drivers/mssql/mssql_utility.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * MS SQL Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mssql_utility extends CI_DB_utility { diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index dc020c624..6ded6e531 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -25,7 +37,7 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysql_driver extends CI_DB { @@ -594,7 +606,7 @@ class CI_DB_mysql_driver extends CI_DB { * @param array the limit clause * @return string */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + function _update($table, $values, $where, $orderby = array(), $limit = FALSE, $like = array()) { foreach ($values as $key => $val) { @@ -608,6 +620,16 @@ class CI_DB_mysql_driver extends CI_DB { $sql = "UPDATE ".$table." SET ".implode(', ', $valstr); $sql .= ($where != '' AND count($where) >=1) ? " WHERE ".implode(" ", $where) : ''; + + if (count($like) > 0) + { + $sql .= ($where == '' AND count($where) <1) ? " WHERE " : ' AND '; + + foreach ($like as $st_like) + { + $sql .= " " . $st_like; + } + } $sql .= $orderby.$limit; diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php index c1cae136c..89aaf5de3 100644 --- a/system/database/drivers/mysql/mysql_forge.php +++ b/system/database/drivers/mysql/mysql_forge.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * MySQL Forge Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysql_forge extends CI_DB_forge { diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php index 6ceaf4b9b..29297b6a4 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * This class extends the parent result class: CI_DB_result * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysql_result extends CI_DB_result { @@ -86,10 +98,10 @@ class CI_DB_mysql_result extends CI_DB_result { $retval = array(); while ($field = mysql_fetch_object($this->result_id)) { - preg_match('/([a-zA-Z]+)(\((\d+)\))?/i', $field->Type, $matches); + preg_match('/([a-zA-Z]+)(\(\d+\))?/', $field->Type, $matches); - $type = $matches[1]; - $length = isset($matches[3]) ? (int) $matches[3] : NULL; + $type = (array_key_exists(1, $matches)) ? $matches[1] : NULL; + $length = (array_key_exists(2, $matches)) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL; $F = new stdClass(); $F->name = $field->Field; diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php index 48c4d6316..9cb6645eb 100644 --- a/system/database/drivers/mysql/mysql_utility.php +++ b/system/database/drivers/mysql/mysql_utility.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * MySQL Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysql_utility extends CI_DB_utility { diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index abef80fbd..fb5953bd7 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -25,7 +37,7 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysqli_driver extends CI_DB { @@ -562,6 +574,25 @@ class CI_DB_mysqli_driver extends CI_DB { // -------------------------------------------------------------------- + + /** + * Replace statement + * + * Generates a platform-specific replace string from the supplied data + * + * @access public + * @param string the table name + * @param array the insert keys + * @param array the insert values + * @return string + */ + function _replace($table, $keys, $values) + { + return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + /** * Update statement * diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index 260549457..cdd5399f2 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * MySQLi Forge Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysqli_forge extends CI_DB_forge { diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index bbfb8481a..163788b6c 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * This class extends the parent result class: CI_DB_result * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysqli_result extends CI_DB_result { @@ -86,10 +98,10 @@ class CI_DB_mysqli_result extends CI_DB_result { $retval = array(); while ($field = mysqli_fetch_object($this->result_id)) { - preg_match('/([a-zA-Z]+)(\((\d+)\))?/i', $field->Type, $matches); + preg_match('/([a-zA-Z]+)(\(\d+\))?/', $field->Type, $matches); - $type = $matches[1]; - $length = isset($matches[3]) ? (int) $matches[3] : NULL; + $type = (array_key_exists(1, $matches)) ? $matches[1] : NULL; + $length = (array_key_exists(2, $matches)) ? preg_replace('/[^\d]/', '', $matches[2]) : NULL; $F = new stdClass(); $F->name = $field->Field; diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php index e17889b8c..ef7c89fab 100644 --- a/system/database/drivers/mysqli/mysqli_utility.php +++ b/system/database/drivers/mysqli/mysqli_utility.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * MySQLi Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_mysqli_utility extends CI_DB_utility { diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 1cf063ec1..9c38dcbd6 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -25,7 +37,7 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ @@ -35,8 +47,6 @@ * This is a modification of the DB_driver class to * permit access to oracle databases * - * NOTE: this uses the PHP 4 oci methods - * * @author Kelly McArdle * */ @@ -77,9 +87,9 @@ class CI_DB_oci8_driver extends CI_DB { * @access private called by the base class * @return resource */ - function db_connect() + public function db_connect() { - return @ocilogon($this->username, $this->password, $this->hostname, $this->char_set); + return @oci_connect($this->username, $this->password, $this->hostname, $this->char_set); } // -------------------------------------------------------------------- @@ -90,9 +100,9 @@ class CI_DB_oci8_driver extends CI_DB { * @access private called by the base class * @return resource */ - function db_pconnect() + public function db_pconnect() { - return @ociplogon($this->username, $this->password, $this->hostname, $this->char_set); + return @oci_pconnect($this->username, $this->password, $this->hostname, $this->char_set); } // -------------------------------------------------------------------- @@ -106,9 +116,10 @@ class CI_DB_oci8_driver extends CI_DB { * @access public * @return void */ - function reconnect() + public function reconnect() { // not implemented in oracle + return; } // -------------------------------------------------------------------- @@ -119,8 +130,9 @@ class CI_DB_oci8_driver extends CI_DB { * @access private called by the base class * @return resource */ - function db_select() + public function db_select() { + // Not in Oracle - schemas are actually usernames return TRUE; } @@ -134,7 +146,7 @@ class CI_DB_oci8_driver extends CI_DB { * @param string * @return resource */ - function db_set_charset($charset, $collation) + public function db_set_charset($charset, $collation) { // this is done upon connect return TRUE; @@ -145,12 +157,12 @@ class CI_DB_oci8_driver extends CI_DB { /** * Version number query string * - * @access public + * @access protected * @return string */ - function _version() + protected function _version() { - return ociserverversion($this->conn_id); + return oci_server_version($this->conn_id); } // -------------------------------------------------------------------- @@ -158,18 +170,18 @@ class CI_DB_oci8_driver extends CI_DB { /** * Execute the query * - * @access private called by the base class + * @access protected called by the base class * @param string an SQL query * @return resource */ - function _execute($sql) + protected function _execute($sql) { // oracle must parse the query before it is run. All of the actions with // the query are based on the statement id returned by ociparse $this->stmt_id = FALSE; $this->_set_stmt_id($sql); - ocisetprefetch($this->stmt_id, 1000); - return @ociexecute($this->stmt_id, $this->_commit); + oci_set_prefetch($this->stmt_id, 1000); + return @oci_execute($this->stmt_id, $this->_commit); } /** @@ -179,11 +191,11 @@ class CI_DB_oci8_driver extends CI_DB { * @param string an SQL query * @return none */ - function _set_stmt_id($sql) + private function _set_stmt_id($sql) { if ( ! is_resource($this->stmt_id)) { - $this->stmt_id = ociparse($this->conn_id, $this->_prep_query($sql)); + $this->stmt_id = oci_parse($this->conn_id, $this->_prep_query($sql)); } } @@ -198,7 +210,7 @@ class CI_DB_oci8_driver extends CI_DB { * @param string an SQL query * @return string */ - function _prep_query($sql) + private function _prep_query($sql) { return $sql; } @@ -211,9 +223,9 @@ class CI_DB_oci8_driver extends CI_DB { * @access public * @return cursor id */ - function get_cursor() + public function get_cursor() { - $this->curs_id = ocinewcursor($this->conn_id); + $this->curs_id = oci_new_cursor($this->conn_id); return $this->curs_id; } @@ -237,7 +249,7 @@ class CI_DB_oci8_driver extends CI_DB { * type yes the type of the parameter * length yes the max size of the parameter */ - function stored_procedure($package, $procedure, $params) + public function stored_procedure($package, $procedure, $params) { if ($package == '' OR $procedure == '' OR ! is_array($params)) { @@ -257,7 +269,7 @@ class CI_DB_oci8_driver extends CI_DB { { $sql .= $param['name'] . ","; - if (array_key_exists('type', $param) && ($param['type'] == OCI_B_CURSOR)) + if (array_key_exists('type', $param) && ($param['type'] === OCI_B_CURSOR)) { $have_cursor = TRUE; } @@ -278,7 +290,7 @@ class CI_DB_oci8_driver extends CI_DB { * @access private * @return none */ - function _bind_params($params) + private function _bind_params($params) { if ( ! is_array($params) OR ! is_resource($this->stmt_id)) { @@ -295,7 +307,7 @@ class CI_DB_oci8_driver extends CI_DB { } } - ocibindbyname($this->stmt_id, $param['name'], $param['value'], $param['length'], $param['type']); + oci_bind_by_name($this->stmt_id, $param['name'], $param['value'], $param['length'], $param['type']); } } @@ -307,7 +319,7 @@ class CI_DB_oci8_driver extends CI_DB { * @access public * @return bool */ - function trans_begin($test_mode = FALSE) + public function trans_begin($test_mode = FALSE) { if ( ! $this->trans_enabled) { @@ -337,7 +349,7 @@ class CI_DB_oci8_driver extends CI_DB { * @access public * @return bool */ - function trans_commit() + public function trans_commit() { if ( ! $this->trans_enabled) { @@ -350,7 +362,7 @@ class CI_DB_oci8_driver extends CI_DB { return TRUE; } - $ret = OCIcommit($this->conn_id); + $ret = oci_commit($this->conn_id); $this->_commit = OCI_COMMIT_ON_SUCCESS; return $ret; } @@ -363,7 +375,7 @@ class CI_DB_oci8_driver extends CI_DB { * @access public * @return bool */ - function trans_rollback() + public function trans_rollback() { if ( ! $this->trans_enabled) { @@ -376,7 +388,7 @@ class CI_DB_oci8_driver extends CI_DB { return TRUE; } - $ret = OCIrollback($this->conn_id); + $ret = oci_rollback($this->conn_id); $this->_commit = OCI_COMMIT_ON_SUCCESS; return $ret; } @@ -391,7 +403,7 @@ class CI_DB_oci8_driver extends CI_DB { * @param bool whether or not the string will be used in a LIKE condition * @return string */ - function escape_str($str, $like = FALSE) + public function escape_str($str, $like = FALSE) { if (is_array($str)) { @@ -425,9 +437,9 @@ class CI_DB_oci8_driver extends CI_DB { * @access public * @return integer */ - function affected_rows() + public function affected_rows() { - return @ocirowcount($this->stmt_id); + return @oci_num_rows($this->stmt_id); } // -------------------------------------------------------------------- @@ -438,7 +450,7 @@ class CI_DB_oci8_driver extends CI_DB { * @access public * @return integer */ - function insert_id() + public function insert_id() { // not supported in oracle return $this->display_error('db_unsupported_function'); @@ -456,7 +468,7 @@ class CI_DB_oci8_driver extends CI_DB { * @param string * @return string */ - function count_all($table = '') + public function count_all($table = '') { if ($table == '') { @@ -482,11 +494,11 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific query string so that the table names can be fetched * - * @access private + * @access protected * @param boolean - * @return string + * @return string */ - function _list_tables($prefix_limit = FALSE) + protected function _list_tables($prefix_limit = FALSE) { $sql = "SELECT TABLE_NAME FROM ALL_TABLES"; @@ -505,11 +517,11 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific query string so that the column names can be fetched * - * @access public + * @access protected * @param string the table name * @return string */ - function _list_columns($table = '') + protected function _list_columns($table = '') { return "SELECT COLUMN_NAME FROM all_tab_columns WHERE table_name = '$table'"; } @@ -525,7 +537,7 @@ class CI_DB_oci8_driver extends CI_DB { * @param string the table name * @return object */ - function _field_data($table) + protected function _field_data($table) { return "SELECT * FROM ".$table." where rownum = 1"; } @@ -535,12 +547,13 @@ class CI_DB_oci8_driver extends CI_DB { /** * The error message string * - * @access private + * @access protected * @return string */ - function _error_message() + protected function _error_message() { - $error = ocierror($this->conn_id); + // If the error was during connection, no conn_id should be passed + $error = is_resource($this->conn_id) ? oci_error($this->conn_id) : oci_error(); return $error['message']; } @@ -549,12 +562,13 @@ class CI_DB_oci8_driver extends CI_DB { /** * The error message number * - * @access private + * @access protected * @return integer */ - function _error_number() + protected function _error_number() { - $error = ocierror($this->conn_id); + // Same as _error_message() + $error = is_resource($this->conn_id) ? oci_error($this->conn_id) : oci_error(); return $error['code']; } @@ -565,11 +579,11 @@ class CI_DB_oci8_driver extends CI_DB { * * This function escapes column and table names * - * @access private + * @access protected * @param string * @return string */ - function _escape_identifiers($item) + protected function _escape_identifiers($item) { if ($this->_escape_char == '') { @@ -608,11 +622,11 @@ class CI_DB_oci8_driver extends CI_DB { * This function implicitly groups FROM tables so there is no confusion * about operator precedence in harmony with SQL standards * - * @access public + * @access protected * @param type * @return type */ - function _from_tables($tables) + protected function _from_tables($tables) { if ( ! is_array($tables)) { @@ -635,9 +649,9 @@ class CI_DB_oci8_driver extends CI_DB { * @param array the insert values * @return string */ - function _insert($table, $keys, $values) + protected function _insert($table, $keys, $values) { - return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + return "INSERT INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; } // -------------------------------------------------------------------- @@ -647,13 +661,12 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific insert string from the supplied data * - * @access public - * @param string the table name - * @param array the insert keys - * @param array the insert values - * @return string + * @param string the table name + * @param array the insert keys + * @param array the insert values + * @return string */ - function _insert_batch($table, $keys, $values) + protected function _insert_batch($table, $keys, $values) { $keys = implode(', ', $keys); $sql = "INSERT ALL\n"; @@ -675,7 +688,7 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific update string from the supplied data * - * @access public + * @access protected * @param string the table name * @param array the update data * @param array the where clause @@ -683,7 +696,7 @@ class CI_DB_oci8_driver extends CI_DB { * @param array the limit clause * @return string */ - function _update($table, $values, $where, $orderby = array(), $limit = FALSE) + protected function _update($table, $values, $where, $orderby = array(), $limit = FALSE) { foreach ($values as $key => $val) { @@ -712,11 +725,11 @@ class CI_DB_oci8_driver extends CI_DB { * If the database does not support the truncate() command * This function maps to "DELETE FROM table" * - * @access public + * @access protected * @param string the table name * @return string */ - function _truncate($table) + protected function _truncate($table) { return "TRUNCATE TABLE ".$table; } @@ -728,13 +741,13 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific delete string from the supplied data * - * @access public + * @access protected * @param string the table name * @param array the where clause * @param string the limit clause * @return string */ - function _delete($table, $where = array(), $like = array(), $limit = FALSE) + protected function _delete($table, $where = array(), $like = array(), $limit = FALSE) { $conditions = ''; @@ -762,13 +775,13 @@ class CI_DB_oci8_driver extends CI_DB { * * Generates a platform-specific LIMIT clause * - * @access public + * @access protected * @param string the sql query string * @param integer the number of rows to limit the query to * @param integer the offset value * @return string */ - function _limit($sql, $limit, $offset) + protected function _limit($sql, $limit, $offset) { $limit = $offset + $limit; $newsql = "SELECT * FROM (select inner_query.*, rownum rnum FROM ($sql) inner_query WHERE rownum < $limit)"; @@ -789,13 +802,13 @@ class CI_DB_oci8_driver extends CI_DB { /** * Close DB Connection * - * @access public + * @access protected * @param resource * @return void */ - function _close($conn_id) + protected function _close($conn_id) { - @ocilogoff($conn_id); + @oci_close($conn_id); } diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php index 3cd17585a..bafab3d1b 100644 --- a/system/database/drivers/oci8/oci8_forge.php +++ b/system/database/drivers/oci8/oci8_forge.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * Oracle Forge Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_oci8_forge extends CI_DB_forge { diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index 2713f6f12..f32559289 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * This class extends the parent result class: CI_DB_result * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_oci8_result extends CI_DB_result { @@ -40,16 +52,16 @@ class CI_DB_oci8_result extends CI_DB_result { * @access public * @return integer */ - function num_rows() + public function num_rows() { if ($this->num_rows === 0 && count($this->result_array()) > 0) { $this->num_rows = count($this->result_array()); - @ociexecute($this->stmt_id); + @oci_execute($this->stmt_id, OCI_DEFAULT); if ($this->curs_id) { - @ociexecute($this->curs_id); + @oci_execute($this->curs_id, OCI_DEFAULT); } } @@ -64,9 +76,9 @@ class CI_DB_oci8_result extends CI_DB_result { * @access public * @return integer */ - function num_fields() + public function num_fields() { - $count = @ocinumcols($this->stmt_id); + $count = @oci_num_fields($this->stmt_id); // if we used a limit we subtract it if ($this->limit_used) @@ -87,13 +99,12 @@ class CI_DB_oci8_result extends CI_DB_result { * @access public * @return array */ - function list_fields() + public function list_fields() { $field_names = array(); - $fieldCount = $this->num_fields(); - for ($c = 1; $c <= $fieldCount; $c++) + for ($c = 1, $fieldCount = $this->num_fields(); $c <= $fieldCount; $c++) { - $field_names[] = ocicolumnname($this->stmt_id, $c); + $field_names[] = oci_field_name($this->stmt_id, $c); } return $field_names; } @@ -108,16 +119,15 @@ class CI_DB_oci8_result extends CI_DB_result { * @access public * @return array */ - function field_data() + public function field_data() { $retval = array(); - $fieldCount = $this->num_fields(); - for ($c = 1; $c <= $fieldCount; $c++) + for ($c = 1, $fieldCount = $this->num_fields(); $c <= $fieldCount; $c++) { - $F = new stdClass(); - $F->name = ocicolumnname($this->stmt_id, $c); - $F->type = ocicolumntype($this->stmt_id, $c); - $F->max_length = ocicolumnsize($this->stmt_id, $c); + $F = new stdClass(); + $F->name = oci_field_name($this->stmt_id, $c); + $F->type = oci_field_type($this->stmt_id, $c); + $F->max_length = oci_field_size($this->stmt_id, $c); $retval[] = $F; } @@ -132,11 +142,11 @@ class CI_DB_oci8_result extends CI_DB_result { * * @return null */ - function free_result() + public function free_result() { if (is_resource($this->result_id)) { - ocifreestatement($this->result_id); + oci_free_statement($this->result_id); $this->result_id = FALSE; } } @@ -148,14 +158,13 @@ class CI_DB_oci8_result extends CI_DB_result { * * Returns the result set as an array * - * @access private + * @access protected * @return array */ - function _fetch_assoc(&$row) + protected function _fetch_assoc() { $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id; - - return ocifetchinto($id, $row, OCI_ASSOC + OCI_RETURN_NULLS); + return oci_fetch_assoc($id); } // -------------------------------------------------------------------- @@ -165,41 +174,13 @@ class CI_DB_oci8_result extends CI_DB_result { * * Returns the result set as an object * - * @access private + * @access protected * @return object */ - function _fetch_object() + protected function _fetch_object() { - $result = array(); - - // If PHP 5 is being used we can fetch an result object - if (function_exists('oci_fetch_object')) - { - $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id; - - return @oci_fetch_object($id); - } - - // If PHP 4 is being used we have to build our own result - foreach ($this->result_array() as $key => $val) - { - $obj = new stdClass(); - if (is_array($val)) - { - foreach ($val as $k => $v) - { - $obj->$k = $v; - } - } - else - { - $obj->$key = $val; - } - - $result[] = $obj; - } - - return $result; + $id = ($this->curs_id) ? $this->curs_id : $this->stmt_id; + return @oci_fetch_object($id); } // -------------------------------------------------------------------- @@ -210,17 +191,15 @@ class CI_DB_oci8_result extends CI_DB_result { * @access public * @return array */ - function result_array() + public function result_array() { if (count($this->result_array) > 0) { return $this->result_array; } - // oracle's fetch functions do not return arrays. - // The information is returned in reference parameters $row = NULL; - while ($this->_fetch_assoc($row)) + while ($row = $this->_fetch_assoc()) { $this->result_array[] = $row; } @@ -237,10 +216,10 @@ class CI_DB_oci8_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private + * @access protected * @return array */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return FALSE; // Not needed } diff --git a/system/database/drivers/oci8/oci8_utility.php b/system/database/drivers/oci8/oci8_utility.php index 854b467e1..28c374d99 100644 --- a/system/database/drivers/oci8/oci8_utility.php +++ b/system/database/drivers/oci8/oci8_utility.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * Oracle Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_oci8_utility extends CI_DB_utility { diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index bcd7937d9..0e9d46d3f 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -25,7 +37,7 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_odbc_driver extends CI_DB { diff --git a/system/database/drivers/odbc/odbc_forge.php b/system/database/drivers/odbc/odbc_forge.php index 3ec86b4e9..e326a2801 100644 --- a/system/database/drivers/odbc/odbc_forge.php +++ b/system/database/drivers/odbc/odbc_forge.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * ODBC Forge Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/database/ */ class CI_DB_odbc_forge extends CI_DB_forge { diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index 5d64a464f..b23a821d3 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * This class extends the parent result class: CI_DB_result * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_odbc_result extends CI_DB_result { diff --git a/system/database/drivers/odbc/odbc_utility.php b/system/database/drivers/odbc/odbc_utility.php index d335bed99..94666acbf 100644 --- a/system/database/drivers/odbc/odbc_utility.php +++ b/system/database/drivers/odbc/odbc_utility.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * ODBC Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/database/ */ class CI_DB_odbc_utility extends CI_DB_utility { diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index 19e069b06..457cf714a 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.1.0 * @filesource @@ -25,7 +37,7 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_pdo_driver extends CI_DB { @@ -45,7 +57,8 @@ class CI_DB_pdo_driver extends CI_DB { */ var $_count_string = "SELECT COUNT(*) AS "; var $_random_keyword; - + + var $options = array(); function __construct($params) { @@ -56,6 +69,15 @@ class CI_DB_pdo_driver extends CI_DB { { $this->_like_escape_str = ''; $this->_like_escape_chr = ''; + + //Prior to this version, the charset can't be set in the dsn + if(is_php('5.3.6')) + { + $this->hostname .= ";charset={$this->char_set}"; + } + + //Set the charset with the connection options + $this->options['PDO::MYSQL_ATTR_INIT_COMMAND'] = "SET NAMES {$this->char_set}"; } else if (strpos($this->hostname, 'odbc') !== FALSE) { @@ -68,7 +90,11 @@ class CI_DB_pdo_driver extends CI_DB { $this->_like_escape_chr = '!'; } - $this->hostname = $this->hostname . ";dbname=".$this->database; + if (strpos($this->hostname, 'sqlite') === FALSE) + { + $this->hostname .= ";dbname=".$this->database; + } + $this->trans_enabled = FALSE; $this->_random_keyword = ' RND('.time().')'; // database specific random keyword @@ -82,9 +108,9 @@ class CI_DB_pdo_driver extends CI_DB { */ function db_connect() { - return new PDO($this->hostname,$this->username,$this->password, array( - PDO::ATTR_ERRMODE => PDO::ERRMODE_SILENT - )); + $this->options['PDO::ATTR_ERRMODE'] = PDO::ERRMODE_SILENT; + + return new PDO($this->hostname, $this->username, $this->password, $this->options); } // -------------------------------------------------------------------- @@ -97,10 +123,10 @@ class CI_DB_pdo_driver extends CI_DB { */ function db_pconnect() { - return new PDO($this->hostname,$this->username,$this->password, array( - PDO::ATTR_ERRMODE => PDO::ERRMODE_SILENT, - PDO::ATTR_PERSISTENT => true - )); + $this->options['PDO::ATTR_ERRMODE'] = PDO::ERRMODE_SILENT; + $this->options['PDO::ATTR_PERSISTENT'] = TRUE; + + return new PDO($this->hostname, $this->username, $this->password, $this->options); } // -------------------------------------------------------------------- @@ -232,7 +258,7 @@ class CI_DB_pdo_driver extends CI_DB { // Reset the transaction failure flag. // If the $test_mode flag is set to TRUE transactions will be rolled back // even if the queries produce a successful result. - $this->_trans_failure = ($test_mode === TRUE) ? TRUE : FALSE; + $this->_trans_failure = (bool) ($test_mode === TRUE); return $this->conn_id->beginTransaction(); } diff --git a/system/database/drivers/pdo/pdo_forge.php b/system/database/drivers/pdo/pdo_forge.php index 5516873c0..bf3066529 100644 --- a/system/database/drivers/pdo/pdo_forge.php +++ b/system/database/drivers/pdo/pdo_forge.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.1.0 * @filesource @@ -19,7 +31,7 @@ * PDO Forge Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/database/ */ class CI_DB_pdo_forge extends CI_DB_forge { diff --git a/system/database/drivers/pdo/pdo_result.php b/system/database/drivers/pdo/pdo_result.php index e3ae0da4b..559c2edb3 100644 --- a/system/database/drivers/pdo/pdo_result.php +++ b/system/database/drivers/pdo/pdo_result.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.1.0 * @filesource @@ -21,7 +33,7 @@ * This class extends the parent result class: CI_DB_result * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_pdo_result extends CI_DB_result { diff --git a/system/database/drivers/pdo/pdo_utility.php b/system/database/drivers/pdo/pdo_utility.php index 50b9746de..90b46af3e 100644 --- a/system/database/drivers/pdo/pdo_utility.php +++ b/system/database/drivers/pdo/pdo_utility.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.1.0 * @filesource @@ -19,7 +31,7 @@ * PDO Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/database/ */ class CI_DB_pdo_utility extends CI_DB_utility { diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php index 5367f9759..50f096b5d 100644 --- a/system/database/drivers/postgre/postgre_driver.php +++ b/system/database/drivers/postgre/postgre_driver.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -25,7 +37,7 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_postgre_driver extends CI_DB { diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index 91a1c6861..f86ba2dda 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * Postgre Forge Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_postgre_forge extends CI_DB_forge { @@ -69,9 +81,10 @@ class CI_DB_postgre_forge extends CI_DB_forge { if ($if_not_exists === TRUE) { + // PostgreSQL doesn't support IF NOT EXISTS syntax so we check if table exists manually if ($this->db->table_exists($table)) { - return "SELECT * FROM $table"; // Needs to return innocous but valid SQL statement + return TRUE; } } @@ -212,9 +225,6 @@ class CI_DB_postgre_forge extends CI_DB_forge { /** * Drop Table - * - * @access private - * @return bool */ function _drop_table($table) { diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php index e9a1d1607..808e8bf72 100644 --- a/system/database/drivers/postgre/postgre_result.php +++ b/system/database/drivers/postgre/postgre_result.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * This class extends the parent result class: CI_DB_result * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_postgre_result extends CI_DB_result { diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php index 741c52ea8..f81f85782 100644 --- a/system/database/drivers/postgre/postgre_utility.php +++ b/system/database/drivers/postgre/postgre_utility.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * Postgre Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_postgre_utility extends CI_DB_utility { diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php index 0cc898b38..a6257cb1f 100644 --- a/system/database/drivers/sqlite/sqlite_driver.php +++ b/system/database/drivers/sqlite/sqlite_driver.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -27,7 +39,7 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_sqlite_driver extends CI_DB { diff --git a/system/database/drivers/sqlite/sqlite_forge.php b/system/database/drivers/sqlite/sqlite_forge.php index 56904082e..96a5e0edb 100644 --- a/system/database/drivers/sqlite/sqlite_forge.php +++ b/system/database/drivers/sqlite/sqlite_forge.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * SQLite Forge Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_sqlite_forge extends CI_DB_forge { diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index 7bd30db7c..2bbd1dbc0 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * This class extends the parent result class: CI_DB_result * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_sqlite_result extends CI_DB_result { diff --git a/system/database/drivers/sqlite/sqlite_utility.php b/system/database/drivers/sqlite/sqlite_utility.php index 508023e2f..c9914f28d 100644 --- a/system/database/drivers/sqlite/sqlite_utility.php +++ b/system/database/drivers/sqlite/sqlite_utility.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * SQLite Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_sqlite_utility extends CI_DB_utility { diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index 1021db945..340cd3a66 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -25,7 +37,7 @@ * @package CodeIgniter * @subpackage Drivers * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_sqlsrv_driver extends CI_DB { diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php index cc88ec5ca..4fa0596cd 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_forge.php +++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * SQLSRV Forge Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_sqlsrv_forge extends CI_DB_forge { diff --git a/system/database/drivers/sqlsrv/sqlsrv_result.php b/system/database/drivers/sqlsrv/sqlsrv_result.php index bf0abd1c6..38aaec723 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_result.php +++ b/system/database/drivers/sqlsrv/sqlsrv_result.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * This class extends the parent result class: CI_DB_result * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_sqlsrv_result extends CI_DB_result { diff --git a/system/database/drivers/sqlsrv/sqlsrv_utility.php b/system/database/drivers/sqlsrv/sqlsrv_utility.php index 13a1850c4..f58b5bd04 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_utility.php +++ b/system/database/drivers/sqlsrv/sqlsrv_utility.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -19,7 +31,7 @@ * SQLSRV Utility Class * * @category Database - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/database/ */ class CI_DB_sqlsrv_utility extends CI_DB_utility { diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php index 075a31fdf..6b8695c11 100644 --- a/system/helpers/array_helper.php +++ b/system/helpers/array_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/array_helper.html */ diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 2bbb9d3a5..0fed81996 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/xml_helper.html */ diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index 7cee02827..a4c1e4966 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/cookie_helper.html */ diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index e14bc2f94..49dbdbeb3 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/date_helper.html */ @@ -84,14 +96,14 @@ if ( ! function_exists('mdate')) { if ($datestr == '') { - return ''; + return ''; } $time = ($time == '') ? now() : $time; $datestr = str_replace( - '%\\', - '', + '%\\', + '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr) ); @@ -120,7 +132,7 @@ if ( ! function_exists('standard_date')) 'DATE_COOKIE' => '%l, %d-%M-%y %H:%i:%s UTC', 'DATE_ISO8601' => '%Y-%m-%dT%H:%i:%s%Q', 'DATE_RFC822' => '%D, %d %M %y %H:%i:%s %O', - 'DATE_RFC850' => '%l, %d-%M-%y %H:%m:%i UTC', + 'DATE_RFC850' => '%l, %d-%M-%y %H:%i:%s UTC', 'DATE_RFC1036' => '%D, %d %M %y %H:%i:%s %O', 'DATE_RFC1123' => '%D, %d %M %Y %H:%i:%s %O', 'DATE_RSS' => '%D, %d %M %Y %H:%i:%s %O', @@ -169,15 +181,15 @@ if ( ! function_exists('timespan')) $seconds = ($time <= $seconds) ? 1 : $time - $seconds; $str = ''; - $years = floor($seconds / 31536000); + $years = floor($seconds / 31557600); if ($years > 0) { $str .= $years.' '.$CI->lang->line((($years > 1) ? 'date_years' : 'date_year')).', '; } - $seconds -= $years * 31536000; - $months = floor($seconds / 2628000); + $seconds -= $years * 31557600; + $months = floor($seconds / 2629743); if ($years > 0 OR $months > 0) { @@ -186,7 +198,7 @@ if ( ! function_exists('timespan')) $str .= $months.' '.$CI->lang->line((($months > 1) ? 'date_months' : 'date_month')).', '; } - $seconds -= $months * 2628000; + $seconds -= $months * 2629743; } $weeks = floor($seconds / 604800); @@ -303,13 +315,13 @@ if ( ! function_exists('local_to_gmt')) { $time = time(); } - + return mktime( - gmdate("H", $time), - gmdate("i", $time), - gmdate("s", $time), - gmdate("m", $time), - gmdate("d", $time), + gmdate("H", $time), + gmdate("i", $time), + gmdate("s", $time), + gmdate("m", $time), + gmdate("d", $time), gmdate("Y", $time) ); } @@ -482,17 +494,17 @@ if ( ! function_exists('human_to_unix')) if (substr($ampm, 0, 1) == 'p' AND $hour < 12) { - $hour = $hour + 12; + $hour = $hour + 12; } if (substr($ampm, 0, 1) == 'a' AND $hour == 12) { $hour = '00'; } - + if (strlen($hour) == 1) { - $hour = '0'.$hour; + $hour = '0'.$hour; } } @@ -505,7 +517,7 @@ if ( ! function_exists('human_to_unix')) /** * Turns many "reasonably-date-like" strings into something * that is actually useful. This only works for dates after unix epoch. - * + * * @access public * @param string The terribly formatted date-like string * @param string Date format to return (same as php date function) @@ -513,7 +525,7 @@ if ( ! function_exists('human_to_unix')) */ if ( ! function_exists('nice_date')) { - function nice_date($bad_date = '', $format = FALSE) + function nice_date($bad_date = '', $format = FALSE) { if (empty($bad_date)) { @@ -521,47 +533,47 @@ if ( ! function_exists('nice_date')) } // Date like: YYYYMM - if (preg_match('/^\d{6}$/', $bad_date)) + if (preg_match('/^\d{6}$/', $bad_date)) { - if (in_array(substr($bad_date, 0, 2),array('19', '20'))) + if (in_array(substr($bad_date, 0, 2),array('19', '20'))) { $year = substr($bad_date, 0, 4); $month = substr($bad_date, 4, 2); - } - else + } + else { $month = substr($bad_date, 0, 2); $year = substr($bad_date, 2, 4); } - + return date($format, strtotime($year . '-' . $month . '-01')); } - + // Date Like: YYYYMMDD - if (preg_match('/^\d{8}$/',$bad_date)) + if (preg_match('/^\d{8}$/',$bad_date)) { $month = substr($bad_date, 0, 2); $day = substr($bad_date, 2, 2); $year = substr($bad_date, 4, 4); - + return date($format, strtotime($month . '/01/' . $year)); } - + // Date Like: MM-DD-YYYY __or__ M-D-YYYY (or anything in between) if (preg_match('/^\d{1,2}-\d{1,2}-\d{4}$/',$bad_date)) - { + { list($m, $d, $y) = explode('-', $bad_date); return date($format, strtotime("{$y}-{$m}-{$d}")); } - + // Any other kind of string, when converted into UNIX time, // produces "0 seconds after epoc..." is probably bad... // return "Invalid Date". if (date('U', strtotime($bad_date)) == '0') - { + { return "Invalid Date"; } - + // It's probably a valid-ish date format already return date($format, strtotime($bad_date)); } @@ -676,9 +688,9 @@ if ( ! function_exists('timezones')) { return $zones; } - + $tz = ($tz == 'GMT') ? 'UTC' : $tz; - + return ( ! isset($zones[$tz])) ? 0 : $zones[$tz]; } } diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php index 38347fa62..cb37446f8 100644 --- a/system/helpers/directory_helper.php +++ b/system/helpers/directory_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/directory_helper.html */ diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 1145688ae..5f5d1aaf7 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/download_helper.html */ diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php index 651aef439..22099e58a 100644 --- a/system/helpers/email_helper.php +++ b/system/helpers/email_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/email_helper.html */ diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 3931667fd..5b5085381 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/file_helpers.html */ diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index 130daee6a..347e8be90 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/form_helper.html */ @@ -988,7 +1000,7 @@ if ( ! function_exists('_attributes_to_string')) $attributes = (array)$attributes; } - if (is_array($attributes) AND count($attributes) > 0) + if (is_array($attributes) AND ($formtag === TRUE OR count($attributes) > 0)) { $atts = ''; diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php index 10a288e6a..b6bb402a8 100644 --- a/system/helpers/html_helper.php +++ b/system/helpers/html_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/html_helper.html */ diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index 7b99bc5b4..7c5082192 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/directory_helper.html */ @@ -44,35 +56,35 @@ if ( ! function_exists('singular')) $result = strval($str); $singular_rules = array( - '/(matr)ices$/' => '\1ix', - '/(vert|ind)ices$/' => '\1ex', - '/^(ox)en/' => '\1', - '/(alias)es$/' => '\1', - '/([octop|vir])i$/' => '\1us', - '/(cris|ax|test)es$/' => '\1is', - '/(shoe)s$/' => '\1', - '/(o)es$/' => '\1', - '/(bus|campus)es$/' => '\1', - '/([m|l])ice$/' => '\1ouse', - '/(x|ch|ss|sh)es$/' => '\1', - '/(m)ovies$/' => '\1\2ovie', - '/(s)eries$/' => '\1\2eries', - '/([^aeiouy]|qu)ies$/' => '\1y', - '/([lr])ves$/' => '\1f', - '/(tive)s$/' => '\1', - '/(hive)s$/' => '\1', - '/([^f])ves$/' => '\1fe', - '/(^analy)ses$/' => '\1sis', + '/(matr)ices$/' => '\1ix', + '/(vert|ind)ices$/' => '\1ex', + '/^(ox)en/' => '\1', + '/(alias)es$/' => '\1', + '/([octop|vir])i$/' => '\1us', + '/(cris|ax|test)es$/' => '\1is', + '/(shoe)s$/' => '\1', + '/(o)es$/' => '\1', + '/(bus|campus)es$/' => '\1', + '/([m|l])ice$/' => '\1ouse', + '/(x|ch|ss|sh)es$/' => '\1', + '/(m)ovies$/' => '\1\2ovie', + '/(s)eries$/' => '\1\2eries', + '/([^aeiouy]|qu)ies$/' => '\1y', + '/([lr])ves$/' => '\1f', + '/(tive)s$/' => '\1', + '/(hive)s$/' => '\1', + '/([^f])ves$/' => '\1fe', + '/(^analy)ses$/' => '\1sis', '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/' => '\1\2sis', - '/([ti])a$/' => '\1um', - '/(p)eople$/' => '\1\2erson', - '/(m)en$/' => '\1an', - '/(s)tatuses$/' => '\1\2tatus', - '/(c)hildren$/' => '\1\2hild', - '/(n)ews$/' => '\1\2ews', - '/([^u])s$/' => '\1', + '/([ti])a$/' => '\1um', + '/(p)eople$/' => '\1\2erson', + '/(m)en$/' => '\1an', + '/(s)tatuses$/' => '\1\2tatus', + '/(c)hildren$/' => '\1\2hild', + '/(n)ews$/' => '\1\2ews', + '/([^u])s$/' => '\1', ); - + foreach ($singular_rules as $rule => $replacement) { if (preg_match($rule, $result)) @@ -103,27 +115,27 @@ if ( ! function_exists('plural')) function plural($str, $force = FALSE) { $result = strval($str); - + $plural_rules = array( - '/^(ox)$/' => '\1\2en', // ox - '/([m|l])ouse$/' => '\1ice', // mouse, louse - '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index - '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address - '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency - '/(hive)$/' => '\1s', // archive, hive - '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife - '/sis$/' => 'ses', // basis, diagnosis - '/([ti])um$/' => '\1a', // datum, medium - '/(p)erson$/' => '\1eople', // person, salesperson - '/(m)an$/' => '\1en', // man, woman, spokesman - '/(c)hild$/' => '\1hildren', // child - '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato - '/(bu|campu)s$/' => '\1\2ses', // bus, campus - '/(alias|status|virus)/' => '\1es', // alias - '/(octop)us$/' => '\1i', // octopus - '/(ax|cris|test)is$/' => '\1es', // axis, crisis - '/s$/' => 's', // no change (compatibility) - '/$/' => 's', + '/^(ox)$/' => '\1\2en', // ox + '/([m|l])ouse$/' => '\1ice', // mouse, louse + '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index + '/(x|ch|ss|sh)$/' => '\1es', // search, switch, fix, box, process, address + '/([^aeiouy]|qu)y$/' => '\1ies', // query, ability, agency + '/(hive)$/' => '\1s', // archive, hive + '/(?:([^f])fe|([lr])f)$/' => '\1\2ves', // half, safe, wife + '/sis$/' => 'ses', // basis, diagnosis + '/([ti])um$/' => '\1a', // datum, medium + '/(p)erson$/' => '\1eople', // person, salesperson + '/(m)an$/' => '\1en', // man, woman, spokesman + '/(c)hild$/' => '\1hildren', // child + '/(buffal|tomat)o$/' => '\1\2oes', // buffalo, tomato + '/(bu|campu)s$/' => '\1\2ses', // bus, campus + '/(alias|status|virus)/' => '\1es', // alias + '/(octop)us$/' => '\1i', // octopus + '/(ax|cris|test)is$/' => '\1es', // axis, crisis + '/s$/' => 's', // no change (compatibility) + '/$/' => 's', ); foreach ($plural_rules as $rule => $replacement) @@ -184,20 +196,20 @@ if ( ! function_exists('underscore')) /** * Humanize * - * Takes multiple words separated by underscores and changes them to spaces + * Takes multiple words separated by the separator and changes them to spaces * * @access public - * @param string + * @param string $str + * @param string $separator * @return str */ if ( ! function_exists('humanize')) { - function humanize($str) + function humanize($str, $separator = '_') { - return ucwords(preg_replace('/[_]+/', ' ', strtolower(trim($str)))); + return ucwords(preg_replace('/['.$separator.']+/', ' ', strtolower(trim($str)))); } } - /* End of file inflector_helper.php */ /* Location: ./system/helpers/inflector_helper.php */
\ No newline at end of file diff --git a/system/helpers/language_helper.php b/system/helpers/language_helper.php index ac0d69da1..b5217c903 100644 --- a/system/helpers/language_helper.php +++ b/system/helpers/language_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/language_helper.html */ diff --git a/system/helpers/number_helper.php b/system/helpers/number_helper.php index 611777559..71cdabb60 100644 --- a/system/helpers/number_helper.php +++ b/system/helpers/number_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/number_helper.html */ diff --git a/system/helpers/path_helper.php b/system/helpers/path_helper.php index ffcf46842..bca9dcb25 100644 --- a/system/helpers/path_helper.php +++ b/system/helpers/path_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/xml_helper.html */ diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php index 678dac821..ad4e29a87 100644 --- a/system/helpers/security_helper.php +++ b/system/helpers/security_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/security_helper.html */ diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php index 6d8889354..38e2965fc 100644 --- a/system/helpers/smiley_helper.php +++ b/system/helpers/smiley_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/smiley_helper.html */ @@ -231,7 +243,7 @@ if ( ! function_exists('_get_smiley_array')) { if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php')) { - include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); + include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'); } elseif (file_exists(APPPATH.'config/smileys.php')) { diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php index dd8ffaddb..6691681e0 100644 --- a/system/helpers/string_helper.php +++ b/system/helpers/string_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/string_helper.html */ diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 33d7fa2fd..38b46e248 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/text_helper.html */ diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index e8cb037a8..b1cedcd9d 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/typography_helper.html */ diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index c524dddd1..5d9afe457 100755 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/url_helper.html */ @@ -381,7 +393,7 @@ if ( ! function_exists('auto_link')) { if ($type != 'email') { - if (preg_match_all("#(^|\s|\()((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches)) + if (preg_match_all("#(^|\s|\(|\b)((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches)) { $pop = ($popup == TRUE) ? " target=\"_blank\" " : ""; @@ -532,13 +544,19 @@ if ( ! function_exists('url_title')) */ if ( ! function_exists('redirect')) { - function redirect($uri = '', $method = 'location', $http_response_code = 302) + function redirect($uri = '', $method = 'auto', $http_response_code = 302) { if ( ! preg_match('#^https?://#i', $uri)) { $uri = site_url($uri); } + // IIS environment likely? Use 'refresh' for better compatibility + if (DIRECTORY_SEPARATOR != '/' && $method == 'auto') + { + $method = 'refresh'; + } + switch($method) { case 'refresh' : header("Refresh:0;url=".$uri); diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php index cdd81ad70..0cf8f13dc 100644 --- a/system/helpers/xml_helper.php +++ b/system/helpers/xml_helper.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Helpers * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/helpers/xml_helper.html */ diff --git a/system/language/english/calendar_lang.php b/system/language/english/calendar_lang.php index 3e6312361..313eee1de 100644 --- a/system/language/english/calendar_lang.php +++ b/system/language/english/calendar_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['cal_su'] = "Su"; $lang['cal_mo'] = "Mo"; diff --git a/system/language/english/date_lang.php b/system/language/english/date_lang.php index c0ace16ef..515feec83 100644 --- a/system/language/english/date_lang.php +++ b/system/language/english/date_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['date_year'] = "Year"; $lang['date_years'] = "Years"; diff --git a/system/language/english/db_lang.php b/system/language/english/db_lang.php index 79b82c73a..f42e469e9 100644 --- a/system/language/english/db_lang.php +++ b/system/language/english/db_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['db_invalid_connection_str'] = 'Unable to determine the database settings based on the connection string you submitted.'; $lang['db_unable_to_connect'] = 'Unable to connect to your database server using the provided settings.'; diff --git a/system/language/english/email_lang.php b/system/language/english/email_lang.php index e3bd113cb..f2dba27a4 100644 --- a/system/language/english/email_lang.php +++ b/system/language/english/email_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['email_must_be_array'] = "The email validation method must be passed an array."; $lang['email_invalid_address'] = "Invalid email address: %s"; diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php index d1cf0399d..1960dfec1 100644 --- a/system/language/english/form_validation_lang.php +++ b/system/language/english/form_validation_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['required'] = "The %s field is required."; $lang['isset'] = "The %s field must have a value."; diff --git a/system/language/english/ftp_lang.php b/system/language/english/ftp_lang.php index 1e5168cf8..e934a19d9 100644 --- a/system/language/english/ftp_lang.php +++ b/system/language/english/ftp_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['ftp_no_connection'] = "Unable to locate a valid connection ID. Please make sure you are connected before peforming any file routines."; $lang['ftp_unable_to_connect'] = "Unable to connect to your FTP server using the supplied hostname."; diff --git a/system/language/english/imglib_lang.php b/system/language/english/imglib_lang.php index 66505da07..b431d39ed 100644 --- a/system/language/english/imglib_lang.php +++ b/system/language/english/imglib_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['imglib_source_image_required'] = "You must specify a source image in your preferences."; $lang['imglib_gd_required'] = "The GD image library is required for this feature."; diff --git a/system/language/english/migration_lang.php b/system/language/english/migration_lang.php index 94cb882fb..d87ac8dee 100644 --- a/system/language/english/migration_lang.php +++ b/system/language/english/migration_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 3.0 + * @filesource + */ $lang['migration_none_found'] = "No migrations were found."; $lang['migration_not_found'] = "This migration could not be found."; diff --git a/system/language/english/number_lang.php b/system/language/english/number_lang.php index 908580914..a4e6c8996 100644 --- a/system/language/english/number_lang.php +++ b/system/language/english/number_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['terabyte_abbr'] = "TB"; $lang['gigabyte_abbr'] = "GB"; diff --git a/system/language/english/profiler_lang.php b/system/language/english/profiler_lang.php index 1111158c8..790abfaf3 100644 --- a/system/language/english/profiler_lang.php +++ b/system/language/english/profiler_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['profiler_database'] = 'DATABASE'; $lang['profiler_controller_info'] = 'CLASS/METHOD'; diff --git a/system/language/english/unit_test_lang.php b/system/language/english/unit_test_lang.php index 070bcd1f2..185d83d0d 100644 --- a/system/language/english/unit_test_lang.php +++ b/system/language/english/unit_test_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['ut_test_name'] = 'Test Name'; $lang['ut_test_datatype'] = 'Test Datatype'; diff --git a/system/language/english/upload_lang.php b/system/language/english/upload_lang.php index 4de9e9e74..2821055b7 100644 --- a/system/language/english/upload_lang.php +++ b/system/language/english/upload_lang.php @@ -1,4 +1,29 @@ <?php +/** + * CodeIgniter + * + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * + * @package CodeIgniter + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com + * @since Version 1.0 + * @filesource + */ $lang['upload_userfile_not_set'] = "Unable to find a post variable called userfile."; $lang['upload_file_exceeds_limit'] = "The uploaded file exceeds the maximum allowed size in your PHP configuration file."; diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php index 61e7aa761..c296fa770 100644 --- a/system/libraries/Cache/Cache.php +++ b/system/libraries/Cache/Cache.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * - * An open source application development framework for PHP 4.3.2 or newer + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. * * @package CodeIgniter - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Core - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link */ class CI_Cache extends CI_Driver_Library { @@ -143,7 +155,7 @@ class CI_Cache extends CI_Driver_Library { * @return void */ private function _initialize($config) - { + { $default_config = array( 'adapter', 'memcached' diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php index de75719c4..f15cf8501 100644 --- a/system/libraries/Cache/drivers/Cache_apc.php +++ b/system/libraries/Cache/drivers/Cache_apc.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Core - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link */ @@ -132,7 +144,7 @@ class CI_Cache_apc extends CI_Driver { */ public function is_supported() { - if ( ! extension_loaded('apc') OR ! function_exists('apc_store')) + if ( ! extension_loaded('apc') OR ini_get('apc.enabled') != "1") { log_message('error', 'The APC PHP extension must be loaded to use APC Cache.'); return FALSE; @@ -148,4 +160,4 @@ class CI_Cache_apc extends CI_Driver { // End Class /* End of file Cache_apc.php */ -/* Location: ./system/libraries/Cache/drivers/Cache_apc.php */
\ No newline at end of file +/* Location: ./system/libraries/Cache/drivers/Cache_apc.php */ diff --git a/system/libraries/Cache/drivers/Cache_dummy.php b/system/libraries/Cache/drivers/Cache_dummy.php index f96a68e27..965bb2bef 100644 --- a/system/libraries/Cache/drivers/Cache_dummy.php +++ b/system/libraries/Cache/drivers/Cache_dummy.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * - * An open source application development framework for PHP 4.3.2 or newer + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. * * @package CodeIgniter - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Core - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link */ diff --git a/system/libraries/Cache/drivers/Cache_file.php b/system/libraries/Cache/drivers/Cache_file.php index 2a89faf09..be392d3d2 100644 --- a/system/libraries/Cache/drivers/Cache_file.php +++ b/system/libraries/Cache/drivers/Cache_file.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * - * An open source application development framework for PHP 4.3.2 or newer + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. * * @package CodeIgniter - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Core - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link */ diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php index 95bdcb350..78cab25d4 100644 --- a/system/libraries/Cache/drivers/Cache_memcached.php +++ b/system/libraries/Cache/drivers/Cache_memcached.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * - * An open source application development framework for PHP 4.3.2 or newer + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. * * @package CodeIgniter - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @copyright Copyright (c) 2006 - 2011 EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 2.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Core - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link */ diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php index df0fd6eeb..605765bf6 100644 --- a/system/libraries/Calendar.php +++ b/system/libraries/Calendar.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,20 +35,20 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/calendar.html */ class CI_Calendar { - var $CI; - var $lang; - var $local_time; - var $template = ''; - var $start_day = 'sunday'; - var $month_type = 'long'; - var $day_type = 'abr'; - var $show_next_prev = FALSE; - var $next_prev_url = ''; + private $CI; + public $lang; + public $local_time; + public $template = ''; + public $start_day = 'sunday'; + public $month_type = 'long'; + public $day_type = 'abr'; + public $show_next_prev = FALSE; + public $next_prev_url = ''; /** * Constructor @@ -73,7 +85,7 @@ class CI_Calendar { * @param array config preferences * @return void */ - function initialize($config = array()) + public function initialize($config = array()) { foreach ($config as $key => $val) { @@ -95,23 +107,30 @@ class CI_Calendar { * @param array the data to be shown in the calendar cells * @return string */ - function generate($year = '', $month = '', $data = array()) + public function generate($year = '', $month = '', $data = array()) { // Set and validate the supplied month/year if ($year == '') - $year = date("Y", $this->local_time); - - if ($month == '') - $month = date("m", $this->local_time); - - if (strlen($year) == 1) + { + $year = date('Y', $this->local_time); + } + elseif (strlen($year) === 1) + { $year = '200'.$year; - - if (strlen($year) == 2) + } + elseif (strlen($year) === 2) + { $year = '20'.$year; + } - if (strlen($month) == 1) + if ($month == '') + { + $month = date('m', $this->local_time); + } + elseif (strlen($month) === 1) + { $month = '0'.$month; + } $adjusted_date = $this->adjust_date($month, $year); @@ -137,9 +156,9 @@ class CI_Calendar { // Set the current month/year/day // We use this to determine the "today" date - $cur_year = date("Y", $this->local_time); - $cur_month = date("m", $this->local_time); - $cur_day = date("j", $this->local_time); + $cur_year = date('Y', $this->local_time); + $cur_month = date('m', $this->local_time); + $cur_day = date('j', $this->local_time); $is_current_month = ($cur_year == $year AND $cur_month == $month) ? TRUE : FALSE; @@ -147,12 +166,7 @@ class CI_Calendar { $this->parse_template(); // Begin building the calendar output - $out = $this->temp['table_open']; - $out .= "\n"; - - $out .= "\n"; - $out .= $this->temp['heading_row_start']; - $out .= "\n"; + $out = $this->temp['table_open']."\n\n".$this->temp['heading_row_start']."\n"; // "previous" month link if ($this->show_next_prev == TRUE) @@ -161,18 +175,16 @@ class CI_Calendar { $this->next_prev_url = preg_replace("/(.+?)\/*$/", "\\1/", $this->next_prev_url); $adjusted_date = $this->adjust_date($month - 1, $year); - $out .= str_replace('{previous_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->temp['heading_previous_cell']); - $out .= "\n"; + $out .= str_replace('{previous_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->temp['heading_previous_cell'])."\n"; } // Heading containing the month/year $colspan = ($this->show_next_prev == TRUE) ? 5 : 7; - $this->temp['heading_title_cell'] = str_replace('{colspan}', $colspan, $this->temp['heading_title_cell']); - $this->temp['heading_title_cell'] = str_replace('{heading}', $this->get_month_name($month)." ".$year, $this->temp['heading_title_cell']); + $this->temp['heading_title_cell'] = str_replace('{colspan}', $colspan, + str_replace('{heading}', $this->get_month_name($month).' '.$year, $this->temp['heading_title_cell'])); - $out .= $this->temp['heading_title_cell']; - $out .= "\n"; + $out .= $this->temp['heading_title_cell']."\n"; // "next" month link if ($this->show_next_prev == TRUE) @@ -181,14 +193,9 @@ class CI_Calendar { $out .= str_replace('{next_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->temp['heading_next_cell']); } - $out .= "\n"; - $out .= $this->temp['heading_row_end']; - $out .= "\n"; - - // Write the cells containing the days of the week - $out .= "\n"; - $out .= $this->temp['week_row_start']; - $out .= "\n"; + $out .= "\n".$this->temp['heading_row_end']."\n\n" + // Write the cells containing the days of the week + .$this->temp['week_row_start']."\n"; $day_names = $this->get_day_names(); @@ -197,33 +204,31 @@ class CI_Calendar { $out .= str_replace('{week_day}', $day_names[($start_day + $i) %7], $this->temp['week_day_cell']); } - $out .= "\n"; - $out .= $this->temp['week_row_end']; - $out .= "\n"; + $out .= "\n".$this->temp['week_row_end']."\n"; // Build the main body of the calendar while ($day <= $total_days) { - $out .= "\n"; - $out .= $this->temp['cal_row_start']; - $out .= "\n"; + $out .= "\n".$this->temp['cal_row_start']."\n"; for ($i = 0; $i < 7; $i++) { - $out .= ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_start_today'] : $this->temp['cal_cell_start']; + $out .= ($is_current_month === TRUE AND $day == $cur_day) ? $this->temp['cal_cell_start_today'] : $this->temp['cal_cell_start']; if ($day > 0 AND $day <= $total_days) { if (isset($data[$day])) { // Cells with content - $temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content']; - $out .= str_replace('{day}', $day, str_replace('{content}', $data[$day], $temp)); + $temp = ($is_current_month === TRUE AND $day == $cur_day) ? + $this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content']; + $out .= str_replace(array('{content}', '{day}'), array($data[$day], $day), $temp); } else { // Cells with no content - $temp = ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content']; + $temp = ($is_current_month === TRUE AND $day == $cur_day) ? + $this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content']; $out .= str_replace('{day}', $day, $temp); } } @@ -233,17 +238,14 @@ class CI_Calendar { $out .= $this->temp['cal_cell_blank']; } - $out .= ($is_current_month == TRUE AND $day == $cur_day) ? $this->temp['cal_cell_end_today'] : $this->temp['cal_cell_end']; + $out .= ($is_current_month === TRUE AND $day == $cur_day) ? $this->temp['cal_cell_end_today'] : $this->temp['cal_cell_end']; $day++; } - $out .= "\n"; - $out .= $this->temp['cal_row_end']; - $out .= "\n"; + $out .= "\n".$this->temp['cal_row_end']."\n"; } - $out .= "\n"; - $out .= $this->temp['table_close']; + $out .= "\n".$this->temp['table_close']; return $out; } @@ -260,7 +262,7 @@ class CI_Calendar { * @param integer the month * @return string */ - function get_month_name($month) + public function get_month_name($month) { if ($this->month_type == 'short') { @@ -275,7 +277,7 @@ class CI_Calendar { if ($this->CI->lang->line($month) === FALSE) { - return ucfirst(str_replace('cal_', '', $month)); + return ucfirst(substr($month, 4)); } return $this->CI->lang->line($month); @@ -293,10 +295,12 @@ class CI_Calendar { * @param string * @return array */ - function get_day_names($day_type = '') + public function get_day_names($day_type = '') { if ($day_type != '') + { $this->day_type = $day_type; + } if ($this->day_type == 'long') { @@ -312,9 +316,9 @@ class CI_Calendar { } $days = array(); - foreach ($day_names as $val) + for ($i = 0, $c = count($day_names); $i < $c; $i++) { - $days[] = ($this->CI->lang->line('cal_'.$val) === FALSE) ? ucfirst($val) : $this->CI->lang->line('cal_'.$val); + $days[] = ($this->CI->lang->line('cal_'.$day_names[$i]) === FALSE) ? ucfirst($day_names[$i]) : $this->CI->lang->line('cal_'.$day_names[$i]); } return $days; @@ -334,7 +338,7 @@ class CI_Calendar { * @param integer the year * @return array */ - function adjust_date($month, $year) + public function adjust_date($month, $year) { $date = array(); @@ -353,7 +357,7 @@ class CI_Calendar { $date['year']--; } - if (strlen($date['month']) == 1) + if (strlen($date['month']) === 1) { $date['month'] = '0'.$date['month']; } @@ -371,7 +375,7 @@ class CI_Calendar { * @param integer the year * @return integer */ - function get_total_days($month, $year) + public function get_total_days($month, $year) { $days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); @@ -402,7 +406,7 @@ class CI_Calendar { * @access public * @return array */ - function default_template() + public function default_template() { return array ( 'table_open' => '<table border="0" cellpadding="4" cellspacing="0">', @@ -440,7 +444,7 @@ class CI_Calendar { * @access public * @return void */ - function parse_template() + public function parse_template() { $this->temp = $this->default_template(); @@ -455,14 +459,11 @@ class CI_Calendar { { if (preg_match("/\{".$val."\}(.*?)\{\/".$val."\}/si", $this->template, $match)) { - $this->temp[$val] = $match['1']; + $this->temp[$val] = $match[1]; } - else + elseif (in_array($val, $today, TRUE)) { - if (in_array($val, $today, TRUE)) - { - $this->temp[$val] = $this->temp[str_replace('_today', '', $val)]; - } + $this->temp[$val] = $this->temp[substr($val, 0, -6)]; } } } @@ -472,4 +473,4 @@ class CI_Calendar { // END CI_Calendar class /* End of file Calendar.php */ -/* Location: ./system/libraries/Calendar.php */
\ No newline at end of file +/* Location: ./system/libraries/Calendar.php */ diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index ab5a70c98..01a0cb8ce 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,18 +33,19 @@ * @package CodeIgniter * @subpackage Libraries * @category Shopping Cart - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/cart.html */ class CI_Cart { // These are the regular expression rules that we use to validate the product ID and product name - var $product_id_rules = '\.a-z0-9_-'; // alpha-numeric, dashes, underscores, or periods - var $product_name_rules = '\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods + public $product_id_rules = '\.a-z0-9_-'; // alpha-numeric, dashes, underscores, or periods + public $product_name_rules = '\.\:\-_ a-z0-9'; // alpha-numeric, dashes, underscores, colons or periods + public $product_name_safe = true; // only allow safe product names // Private variables. Do not change! - var $CI; - var $_cart_contents = array(); + private $CI; + private $_cart_contents = array(); /** @@ -46,28 +59,17 @@ class CI_Cart { $this->CI =& get_instance(); // Are any config settings being passed manually? If so, set them - $config = array(); - if (count($params) > 0) - { - foreach ($params as $key => $val) - { - $config[$key] = $val; - } - } + $config = is_array($params) ? $params : array(); // Load the Sessions class $this->CI->load->library('session', $config); - // Grab the shopping cart array from the session table, if it exists - if ($this->CI->session->userdata('cart_contents') !== FALSE) - { - $this->_cart_contents = $this->CI->session->userdata('cart_contents'); - } - else + // Grab the shopping cart array from the session table + $this->_cart_contents = $this->CI->session->userdata('cart_contents'); + if ($this->_cart_contents === FALSE) { // No cart exists so we'll set some base values - $this->_cart_contents['cart_total'] = 0; - $this->_cart_contents['total_items'] = 0; + $this->_cart_contents = array('cart_total' => 0, 'total_items' => 0); } log_message('debug', "Cart Class Initialized"); @@ -82,10 +84,10 @@ class CI_Cart { * @param array * @return bool */ - function insert($items = array()) + public function insert($items = array()) { // Was any cart data passed? No? Bah... - if ( ! is_array($items) OR count($items) == 0) + if ( ! is_array($items) OR count($items) === 0) { log_message('error', 'The insert method must be passed an array containing data.'); return FALSE; @@ -119,7 +121,7 @@ class CI_Cart { } // Save the cart data if the insert was successful - if ($save_cart == TRUE) + if ($save_cart === TRUE) { $this->_save_cart(); return isset($rowid) ? $rowid : TRUE; @@ -137,10 +139,10 @@ class CI_Cart { * @param array * @return bool */ - function _insert($items = array()) + private function _insert($items = array()) { // Was any cart data passed? No? Bah... - if ( ! is_array($items) OR count($items) == 0) + if ( ! is_array($items) OR count($items) === 0) { log_message('error', 'The insert method must be passed an array containing data.'); return FALSE; @@ -157,10 +159,8 @@ class CI_Cart { // -------------------------------------------------------------------- - // Prep the quantity. It can only be a number. Duh... - $items['qty'] = trim(preg_replace('/([^0-9])/i', '', $items['qty'])); - // Trim any leading zeros - $items['qty'] = trim(preg_replace('/(^[0]+)/i', '', $items['qty'])); + // Prep the quantity. It can only be a number. Duh... also trim any leading zeros + $items['qty'] = (float) $items['qty']; // If the quantity is zero or blank there's nothing for us to do if ( ! is_numeric($items['qty']) OR $items['qty'] == 0) @@ -173,7 +173,7 @@ class CI_Cart { // Validate the product ID. It can only be alpha-numeric, dashes, underscores or periods // Not totally sure we should impose this rule, but it seems prudent to standardize IDs. // Note: These can be user-specified by setting the $this->product_id_rules variable. - if ( ! preg_match("/^[".$this->product_id_rules."]+$/i", $items['id'])) + if ( ! preg_match('/^['.$this->product_id_rules.']+$/i', $items['id'])) { log_message('error', 'Invalid product ID. The product ID can only contain alpha-numeric characters, dashes, and underscores'); return FALSE; @@ -183,7 +183,7 @@ class CI_Cart { // Validate the product name. It can only be alpha-numeric, dashes, underscores, colons or periods. // Note: These can be user-specified by setting the $this->product_name_rules variable. - if ( ! preg_match("/^[".$this->product_name_rules."]+$/i", $items['name'])) + if ($this->product_name_safe && ! preg_match('/^['.$this->product_name_rules.']+$/i', $items['name'])) { log_message('error', 'An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces'); return FALSE; @@ -191,10 +191,8 @@ class CI_Cart { // -------------------------------------------------------------------- - // Prep the price. Remove anything that isn't a number or decimal point. - $items['price'] = trim(preg_replace('/([^0-9\.])/i', '', $items['price'])); - // Trim any leading zeros - $items['price'] = trim(preg_replace('/(^[0]+)/i', '', $items['price'])); + // Prep the price. Remove leading zeros and anything that isn't a number or decimal point. + $items['price'] = (float) $items['price']; // Is the price a valid number? if ( ! is_numeric($items['price'])) @@ -230,20 +228,14 @@ class CI_Cart { // -------------------------------------------------------------------- // Now that we have our unique "row ID", we'll add our cart items to the master array + // grab quantity if it's already there and add it on + $old_quantity = isset($this->_cart_contents[$rowid]['qty']) ? (int) $this->_cart_contents[$rowid]['qty'] : 0; - // let's unset this first, just to make sure our index contains only the data from this submission - unset($this->_cart_contents[$rowid]); + // Re-create the entry, just to make sure our index contains only the data from this submission + $items['rowid'] = $rowid; + $items['qty'] += $old_quantity; + $this->_cart_contents[$rowid] = $items; - // Create a new index with our new row ID - $this->_cart_contents[$rowid]['rowid'] = $rowid; - - // And add the new items to the cart array - foreach ($items as $key => $val) - { - $this->_cart_contents[$rowid][$key] = $val; - } - - // Woot! return $rowid; } @@ -262,10 +254,10 @@ class CI_Cart { * @param string * @return bool */ - function update($items = array()) + public function update($items = array()) { // Was any cart data passed? - if ( ! is_array($items) OR count($items) == 0) + if ( ! is_array($items) OR count($items) === 0) { return FALSE; } @@ -275,9 +267,9 @@ class CI_Cart { // determine the array type is by looking for a required array key named "id". // If it's not found we assume it's a multi-dimensional array $save_cart = FALSE; - if (isset($items['rowid']) AND isset($items['qty'])) + if (isset($items['rowid'], $items['qty'])) { - if ($this->_update($items) == TRUE) + if ($this->_update($items) === TRUE) { $save_cart = TRUE; } @@ -286,9 +278,9 @@ class CI_Cart { { foreach ($items as $val) { - if (is_array($val) AND isset($val['rowid']) AND isset($val['qty'])) + if (is_array($val) && isset($val['rowid'], $val['qty'])) { - if ($this->_update($val) == TRUE) + if ($this->_update($val) === TRUE) { $save_cart = TRUE; } @@ -297,7 +289,7 @@ class CI_Cart { } // Save the cart data if the insert was successful - if ($save_cart == TRUE) + if ($save_cart === TRUE) { $this->_save_cart(); return TRUE; @@ -320,7 +312,7 @@ class CI_Cart { * @param array * @return bool */ - function _update($items = array()) + private function _update($items = array()) { // Without these array indexes there is nothing we can do if ( ! isset($items['qty']) OR ! isset($items['rowid']) OR ! isset($this->_cart_contents[$items['rowid']])) @@ -329,7 +321,7 @@ class CI_Cart { } // Prep the quantity - $items['qty'] = preg_replace('/([^0-9])/i', '', $items['qty']); + $items['qty'] = (float) $items['qty']; // Is the quantity a number? if ( ! is_numeric($items['qty'])) @@ -366,15 +358,10 @@ class CI_Cart { * @access private * @return bool */ - function _save_cart() + private function _save_cart() { - // Unset these so our total can be calculated correctly below - unset($this->_cart_contents['total_items']); - unset($this->_cart_contents['cart_total']); - // Lets add up the individual prices and set the cart sub-total - $total = 0; - $items = 0; + $this->_cart_contents['total_items'] = $this->_cart_contents['cart_total'] = 0; foreach ($this->_cart_contents as $key => $val) { // We make sure the array contains the proper indexes @@ -383,17 +370,11 @@ class CI_Cart { continue; } - $total += ($val['price'] * $val['qty']); - $items += $val['qty']; - - // Set the subtotal + $this->_cart_contents['cart_total'] += ($val['price'] * $val['qty']); + $this->_cart_contents['total_items'] += $val['qty']; $this->_cart_contents[$key]['subtotal'] = ($this->_cart_contents[$key]['price'] * $this->_cart_contents[$key]['qty']); } - // Set the cart total and total items. - $this->_cart_contents['total_items'] = $items; - $this->_cart_contents['cart_total'] = $total; - // Is our cart empty? If so we delete it from the session if (count($this->_cart_contents) <= 2) { @@ -419,7 +400,7 @@ class CI_Cart { * @access public * @return integer */ - function total() + public function total() { return $this->_cart_contents['cart_total']; } @@ -427,6 +408,24 @@ class CI_Cart { // -------------------------------------------------------------------- /** + * Remove Item + * + * Removes an item from the cart + * + * @access public + * @return boolean + */ + public function remove($rowid) + { + // unset & save + unset($this->_cart_contents[$rowid]); + $this->_save_cart(); + return TRUE; + } + + // -------------------------------------------------------------------- + + /** * Total Items * * Returns the total item count @@ -434,7 +433,7 @@ class CI_Cart { * @access public * @return integer */ - function total_items() + public function total_items() { return $this->_cart_contents['total_items']; } @@ -449,9 +448,10 @@ class CI_Cart { * @access public * @return array */ - function contents() + public function contents($newest_first = FALSE) { - $cart = $this->_cart_contents; + // do we want the newest first? + $cart = ($newest_first) ? array_reverse($this->_cart_contents) : $this->_cart_contents; // Remove these so they don't create a problem when showing the cart table unset($cart['total_items']); @@ -469,16 +469,11 @@ class CI_Cart { * that has options associated with it. * * @access public - * @return array + * @return bool */ - function has_options($rowid = '') + public function has_options($rowid = '') { - if ( ! isset($this->_cart_contents[$rowid]['options']) OR count($this->_cart_contents[$rowid]['options']) === 0) - { - return FALSE; - } - - return TRUE; + return (isset($this->_cart_contents[$rowid]['options']) && count($this->_cart_contents[$rowid]['options']) !== 0) ? TRUE : FALSE; } // -------------------------------------------------------------------- @@ -491,14 +486,9 @@ class CI_Cart { * @access public * @return array */ - function product_options($rowid = '') + public function product_options($rowid = '') { - if ( ! isset($this->_cart_contents[$rowid]['options'])) - { - return array(); - } - - return $this->_cart_contents[$rowid]['options']; + return isset($this->_cart_contents[$rowid]['options']) ? $this->_cart_contents[$rowid]['options'] : array(); } // -------------------------------------------------------------------- @@ -509,9 +499,9 @@ class CI_Cart { * Returns the supplied number with commas and a decimal point. * * @access public - * @return integer + * @return string */ - function format_number($n = '') + public function format_number($n = '') { if ($n == '') { @@ -519,7 +509,7 @@ class CI_Cart { } // Remove anything that isn't a number or decimal point. - $n = trim(preg_replace('/([^0-9\.])/i', '', $n)); + $n = (float) $n; return number_format($n, 2, '.', ','); } @@ -532,15 +522,11 @@ class CI_Cart { * Empties the cart and kills the session * * @access public - * @return null + * @return void */ - function destroy() + public function destroy() { - unset($this->_cart_contents); - - $this->_cart_contents['cart_total'] = 0; - $this->_cart_contents['total_items'] = 0; - + $this->_cart_contents = array('cart_total' => 0, 'total_items' => 0); $this->CI->session->unset_userdata('cart_contents'); } @@ -549,4 +535,4 @@ class CI_Cart { // END Cart Class /* End of file Cart.php */ -/* Location: ./system/libraries/Cart.php */
\ No newline at end of file +/* Location: ./system/libraries/Cart.php */ diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php index 9881c1eec..183a95985 100644 --- a/system/libraries/Driver.php +++ b/system/libraries/Driver.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -34,7 +46,7 @@ class CI_Driver_Library { // The first time a child is used it won't exist, so we instantiate it // subsequents calls will go straight to the proper child. - function __get($child) + public function __get($child) { if ( ! isset($this->lib_name)) { @@ -43,11 +55,11 @@ class CI_Driver_Library { // The class will be prefixed with the parent lib $child_class = $this->lib_name.'_'.$child; - + // Remove the CI_ prefix and lowercase $lib_name = ucfirst(strtolower(str_replace('CI_', '', $this->lib_name))); $driver_name = strtolower(str_replace('CI_', '', $child_class)); - + if (in_array($driver_name, array_map('strtolower', $this->valid_drivers))) { // check and see if the driver is in a separate file @@ -107,6 +119,7 @@ class CI_Driver_Library { * @link */ class CI_Driver { + protected $parent; private $methods = array(); @@ -226,4 +239,4 @@ class CI_Driver { // END CI_Driver CLASS /* End of file Driver.php */ -/* Location: ./system/libraries/Driver.php */
\ No newline at end of file +/* Location: ./system/libraries/Driver.php */ diff --git a/system/libraries/Email.php b/system/libraries/Email.php index ef20e1978..1066535c7 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,59 +35,59 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/email.html */ class CI_Email { - var $useragent = "CodeIgniter"; - var $mailpath = "/usr/sbin/sendmail"; // Sendmail path - var $protocol = "mail"; // mail/sendmail/smtp - var $smtp_host = ""; // SMTP Server. Example: mail.earthlink.net - var $smtp_user = ""; // SMTP Username - var $smtp_pass = ""; // SMTP Password - var $smtp_port = "25"; // SMTP Port - var $smtp_timeout = 5; // SMTP Timeout in seconds - var $smtp_crypto = ""; // SMTP Encryption. Can be null, tls or ssl. - var $wordwrap = TRUE; // TRUE/FALSE Turns word-wrap on/off - var $wrapchars = "76"; // Number of characters to wrap at. - var $mailtype = "text"; // text/html Defines email formatting - var $charset = "utf-8"; // Default char set: iso-8859-1 or us-ascii - var $multipart = "mixed"; // "mixed" (in the body) or "related" (separate) - var $alt_message = ''; // Alternative message for HTML emails - var $validate = FALSE; // TRUE/FALSE. Enables email validation - var $priority = "3"; // Default priority (1 - 5) - var $newline = "\n"; // Default newline. "\r\n" or "\n" (Use "\r\n" to comply with RFC 822) - var $crlf = "\n"; // The RFC 2045 compliant CRLF for quoted-printable is "\r\n". Apparently some servers, + public $useragent = "CodeIgniter"; + public $mailpath = "/usr/sbin/sendmail"; // Sendmail path + public $protocol = "mail"; // mail/sendmail/smtp + public $smtp_host = ""; // SMTP Server. Example: mail.earthlink.net + public $smtp_user = ""; // SMTP Username + public $smtp_pass = ""; // SMTP Password + public $smtp_port = "25"; // SMTP Port + public $smtp_timeout = 5; // SMTP Timeout in seconds + public $smtp_crypto = ""; // SMTP Encryption. Can be null, tls or ssl. + public $wordwrap = TRUE; // TRUE/FALSE Turns word-wrap on/off + public $wrapchars = "76"; // Number of characters to wrap at. + public $mailtype = "text"; // text/html Defines email formatting + public $charset = "utf-8"; // Default char set: iso-8859-1 or us-ascii + public $multipart = "mixed"; // "mixed" (in the body) or "related" (separate) + public $alt_message = ''; // Alternative message for HTML emails + public $validate = FALSE; // TRUE/FALSE. Enables email validation + public $priority = "3"; // Default priority (1 - 5) + public $newline = "\n"; // Default newline. "\r\n" or "\n" (Use "\r\n" to comply with RFC 822) + public $crlf = "\n"; // The RFC 2045 compliant CRLF for quoted-printable is "\r\n". Apparently some servers, // even on the receiving end think they need to muck with CRLFs, so using "\n", while // distasteful, is the only thing that seems to work for all environments. - var $send_multipart = TRUE; // TRUE/FALSE - Yahoo does not like multipart alternative, so this is an override. Set to FALSE for Yahoo. - var $bcc_batch_mode = FALSE; // TRUE/FALSE Turns on/off Bcc batch feature - var $bcc_batch_size = 200; // If bcc_batch_mode = TRUE, sets max number of Bccs in each batch - var $_safe_mode = FALSE; - var $_subject = ""; - var $_body = ""; - var $_finalbody = ""; - var $_alt_boundary = ""; - var $_atc_boundary = ""; - var $_header_str = ""; - var $_smtp_connect = ""; - var $_encoding = "8bit"; - var $_IP = FALSE; - var $_smtp_auth = FALSE; - var $_replyto_flag = FALSE; - var $_debug_msg = array(); - var $_recipients = array(); - var $_cc_array = array(); - var $_bcc_array = array(); - var $_headers = array(); - var $_attach_name = array(); - var $_attach_type = array(); - var $_attach_disp = array(); - var $_protocols = array('mail', 'sendmail', 'smtp'); - var $_base_charsets = array('us-ascii', 'iso-2022-'); // 7-bit charsets (excluding language suffix) - var $_bit_depths = array('7bit', '8bit'); - var $_priorities = array('1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)'); + public $send_multipart = TRUE; // TRUE/FALSE - Yahoo does not like multipart alternative, so this is an override. Set to FALSE for Yahoo. + public $bcc_batch_mode = FALSE; // TRUE/FALSE Turns on/off Bcc batch feature + public $bcc_batch_size = 200; // If bcc_batch_mode = TRUE, sets max number of Bccs in each batch + private $_safe_mode = FALSE; + private $_subject = ""; + private $_body = ""; + private $_finalbody = ""; + private $_alt_boundary = ""; + private $_atc_boundary = ""; + private $_header_str = ""; + private $_smtp_connect = ""; + private $_encoding = "8bit"; + private $_IP = FALSE; + private $_smtp_auth = FALSE; + private $_replyto_flag = FALSE; + private $_debug_msg = array(); + private $_recipients = array(); + private $_cc_array = array(); + private $_bcc_array = array(); + private $_headers = array(); + private $_attach_name = array(); + private $_attach_type = array(); + private $_attach_disp = array(); + private $_protocols = array('mail', 'sendmail', 'smtp'); + private $_base_charsets = array('us-ascii', 'iso-2022-'); // 7-bit charsets (excluding language suffix) + private $_bit_depths = array('7bit', '8bit'); + private $_priorities = array('1 (Highest)', '2 (High)', '3 (Normal)', '4 (Low)', '5 (Lowest)'); /** @@ -92,7 +104,7 @@ class CI_Email { else { $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; - $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; + $this->_safe_mode = (bool) @ini_get("safe_mode"); } log_message('debug', "Email Class Initialized"); @@ -128,7 +140,7 @@ class CI_Email { $this->clear(); $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; - $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; + $this->_safe_mode = (bool) @ini_get("safe_mode"); return $this; } @@ -182,7 +194,7 @@ class CI_Email { { if (preg_match( '/\<(.*)\>/', $from, $match)) { - $from = $match['1']; + $from = $match[1]; } if ($this->validate) @@ -225,7 +237,7 @@ class CI_Email { { if (preg_match( '/\<(.*)\>/', $replyto, $match)) { - $replyto = $match['1']; + $replyto = $match[1]; } if ($this->validate) @@ -238,7 +250,7 @@ class CI_Email { $name = $replyto; } - if (strncmp($name, '"', 1) != 0) + if (strncmp($name, '"', 1) !== 0) { $name = '"'.$name.'"'; } @@ -268,7 +280,7 @@ class CI_Email { $this->validate_email($to); } - if ($this->_get_protocol() != 'mail') + if ($this->_get_protocol() !== 'mail') { $this->_set_header('To', implode(", ", $to)); } @@ -308,7 +320,7 @@ class CI_Email { $this->_set_header('Cc', implode(", ", $cc)); - if ($this->_get_protocol() == "smtp") + if ($this->_get_protocol() === 'smtp') { $this->_cc_array = $cc; } @@ -342,7 +354,7 @@ class CI_Email { $this->validate_email($bcc); } - if (($this->_get_protocol() == "smtp") OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size)) + if ($this->_get_protocol() === 'smtp' OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size)) { $this->_bcc_array = $bcc; } @@ -381,7 +393,19 @@ class CI_Email { */ public function message($body) { - $this->_body = stripslashes(rtrim(str_replace("\r", "", $body))); + $this->_body = rtrim(str_replace("\r", "", $body)); + + /* strip slashes only if magic quotes is ON + if we do it with magic quotes OFF, it strips real, user-inputted chars. + + NOTE: In PHP 5.4 get_magic_quotes_gpc() will always return 0 and + it will probably not exist in future versions at all. + */ + if ( ! is_php('5.4') && get_magic_quotes_gpc()) + { + $this->_body = stripslashes($this->_body); + } + return $this; } @@ -394,11 +418,11 @@ class CI_Email { * @param string * @return void */ - public function attach($filename, $disposition = 'attachment') + public function attach($filename, $disposition = '', $newname = NULL) { - $this->_attach_name[] = $filename; + $this->_attach_name[] = array($filename, $newname); $this->_attach_type[] = $this->_mime_types(pathinfo($filename, PATHINFO_EXTENSION)); - $this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters + $this->_attach_disp[] = empty($disposition) ? 'attachment' : $disposition; // Can also be 'inline' Not sure if it matters return $this; } @@ -514,19 +538,13 @@ class CI_Email { */ public function set_priority($n = 3) { - if ( ! is_numeric($n)) + if ( ! is_numeric($n) OR $n < 1 OR $n > 5) { $this->priority = 3; return; } - if ($n < 1 OR $n > 5) - { - $this->priority = 3; - return; - } - - $this->priority = $n; + $this->priority = (int) $n; return $this; } @@ -541,14 +559,7 @@ class CI_Email { */ public function set_newline($newline = "\n") { - if ($newline != "\n" AND $newline != "\r\n" AND $newline != "\r") - { - $this->newline = "\n"; - return; - } - - $this->newline = $newline; - + $this->newline = in_array($newline, array("\n", "\r\n", "\r")) ? $newline : "\n"; return $this; } @@ -563,14 +574,7 @@ class CI_Email { */ public function set_crlf($crlf = "\n") { - if ($crlf != "\n" AND $crlf != "\r\n" AND $crlf != "\r") - { - $this->crlf = "\n"; - return; - } - - $this->crlf = $crlf; - + $this->crlf = ($crlf !== "\n" AND $crlf !== "\r\n" AND $crlf !== "\r") ? "\n" : $crlf; return $this; } @@ -598,9 +602,7 @@ class CI_Email { */ protected function _get_message_id() { - $from = $this->_headers['Return-Path']; - $from = str_replace(">", "", $from); - $from = str_replace("<", "", $from); + $from = str_replace(array('>', '<'), '', $this->_headers['Return-Path']); return "<".uniqid('').strstr($from, '@').">"; } @@ -640,7 +642,7 @@ class CI_Email { foreach ($this->_base_charsets as $charset) { - if (strncmp($charset, $this->charset, strlen($charset)) == 0) + if (strncmp($charset, $this->charset, strlen($charset)) === 0) { $this->_encoding = '7bit'; } @@ -662,15 +664,15 @@ class CI_Email { */ protected function _get_content_type() { - if ($this->mailtype == 'html' && count($this->_attach_name) == 0) + if ($this->mailtype === 'html' && count($this->_attach_name) === 0) { return 'html'; } - elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) + elseif ($this->mailtype === 'html' && count($this->_attach_name) > 0) { return 'html-attach'; } - elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) + elseif ($this->mailtype === 'text' && count($this->_attach_name) > 0) { return 'plain-attach'; } @@ -691,9 +693,9 @@ class CI_Email { protected function _set_date() { $timezone = date("Z"); - $operator = (strncmp($timezone, '-', 1) == 0) ? '-' : '+'; + $operator = (strncmp($timezone, '-', 1) === 0) ? '-' : '+'; $timezone = abs($timezone); - $timezone = floor($timezone/3600) * 100 + ($timezone % 3600 ) / 60; + $timezone = floor($timezone/3600) * 100 + ($timezone % 3600) / 60; return sprintf("%s %s%04d", date("D, j M Y H:i:s"), $operator, $timezone); } @@ -751,7 +753,7 @@ class CI_Email { */ public function valid_email($address) { - return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE; + return (bool) preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address); } // -------------------------------------------------------------------- @@ -767,28 +769,14 @@ class CI_Email { { if ( ! is_array($email)) { - if (preg_match('/\<(.*)\>/', $email, $match)) - { - return $match['1']; - } - else - { - return $email; - } + return (preg_match('/\<(.*)\>/', $email, $match)) ? $match[1] : $email; } $clean_email = array(); foreach ($email as $addy) { - if (preg_match( '/\<(.*)\>/', $addy, $match)) - { - $clean_email[] = $match['1']; - } - else - { - $clean_email[] = $addy; - } + $clean_email[] = (preg_match( '/\<(.*)\>/', $addy, $match)) ? $match[1] : $addy; } return $clean_email; @@ -814,32 +802,15 @@ class CI_Email { return $this->word_wrap($this->alt_message, '76'); } - if (preg_match('/\<body.*?\>(.*)\<\/body\>/si', $this->_body, $match)) - { - $body = $match['1']; - } - else - { - $body = $this->_body; - } - - $body = trim(strip_tags($body)); - $body = preg_replace( '#<!--(.*)--\>#', "", $body); - $body = str_replace("\t", "", $body); + $body = (preg_match('/\<body.*?\>(.*)\<\/body\>/si', $this->_body, $match)) ? $match[1] : $this->_body; + $body = str_replace("\t", '', preg_replace('#<!--(.*)--\>#', '', trim(strip_tags($body)))); for ($i = 20; $i >= 3; $i--) { - $n = ""; - - for ($x = 1; $x <= $i; $x ++) - { - $n .= "\n"; - } - - $body = str_replace($n, "\n\n", $body); + $body = str_replace(str_repeat("\n", $i), "\n\n", $body); } - return $this->word_wrap($body, '76'); + return $this->word_wrap($body, 76); } // -------------------------------------------------------------------- @@ -857,7 +828,7 @@ class CI_Email { // Se the character limit if ($charlim == '') { - $charlim = ($this->wrapchars == "") ? "76" : $this->wrapchars; + $charlim = ($this->wrapchars == "") ? 76 : $this->wrapchars; } // Reduce multiple spaces @@ -874,10 +845,10 @@ class CI_Email { $unwrap = array(); if (preg_match_all("|(\{unwrap\}.+?\{/unwrap\})|s", $str, $matches)) { - for ($i = 0; $i < count($matches['0']); $i++) + for ($i = 0, $c = count($matches[0]); $i < $c; $i++) { - $unwrap[] = $matches['1'][$i]; - $str = str_replace($matches['1'][$i], "{{unwrapped".$i."}}", $str); + $unwrap[] = $matches[1][$i]; + $str = str_replace($matches[1][$i], "{{unwrapped".$i."}}", $str); } } @@ -899,7 +870,7 @@ class CI_Email { } $temp = ''; - while ((strlen($line)) > $charlim) + do { // If the over-length word is a URL we won't wrap it if (preg_match("!\[url.+\]|://|wwww.!", $line)) @@ -911,19 +882,16 @@ class CI_Email { $temp .= substr($line, 0, $charlim-1); $line = substr($line, $charlim-1); } + while (strlen($line) > $charlim); // If $temp contains data it means we had to split up an over-length // word into smaller chunks so we'll add it back to our current line if ($temp != '') { - $output .= $temp.$this->newline.$line; - } - else - { - $output .= $line; + $output .= $temp.$this->newline; } - $output .= $this->newline; + $output .= $line.$this->newline; } // Put our markers back @@ -966,7 +934,7 @@ class CI_Email { */ protected function _write_headers() { - if ($this->protocol == 'mail') + if ($this->protocol === 'mail') { $this->_subject = $this->_headers['Subject']; unset($this->_headers['Subject']); @@ -985,7 +953,7 @@ class CI_Email { } } - if ($this->_get_protocol() == 'mail') + if ($this->_get_protocol() === 'mail') { $this->_header_str = rtrim($this->_header_str); } @@ -1001,7 +969,7 @@ class CI_Email { */ protected function _build_message() { - if ($this->wordwrap === TRUE AND $this->mailtype != 'html') + if ($this->wordwrap === TRUE AND $this->mailtype !== 'html') { $this->_body = $this->word_wrap($this->_body); } @@ -1009,17 +977,17 @@ class CI_Email { $this->_set_boundaries(); $this->_write_headers(); - $hdr = ($this->_get_protocol() == 'mail') ? $this->newline : ''; + $hdr = ($this->_get_protocol() === 'mail') ? $this->newline : ''; $body = ''; switch ($this->_get_content_type()) { case 'plain' : - $hdr .= "Content-Type: text/plain; charset=" . $this->charset . $this->newline; - $hdr .= "Content-Transfer-Encoding: " . $this->_get_encoding(); + $hdr .= "Content-Type: text/plain; charset=" . $this->charset . $this->newline + . "Content-Transfer-Encoding: " . $this->_get_encoding(); - if ($this->_get_protocol() == 'mail') + if ($this->_get_protocol() === 'mail') { $this->_header_str .= $hdr; $this->_finalbody = $this->_body; @@ -1031,33 +999,32 @@ class CI_Email { return; - break; case 'html' : if ($this->send_multipart === FALSE) { - $hdr .= "Content-Type: text/html; charset=" . $this->charset . $this->newline; - $hdr .= "Content-Transfer-Encoding: quoted-printable"; + $hdr .= "Content-Type: text/html; charset=" . $this->charset . $this->newline + . "Content-Transfer-Encoding: quoted-printable"; } else { $hdr .= "Content-Type: multipart/alternative; boundary=\"" . $this->_alt_boundary . "\"" . $this->newline . $this->newline; - $body .= $this->_get_mime_message() . $this->newline . $this->newline; - $body .= "--" . $this->_alt_boundary . $this->newline; + $body .= $this->_get_mime_message() . $this->newline . $this->newline + . "--" . $this->_alt_boundary . $this->newline - $body .= "Content-Type: text/plain; charset=" . $this->charset . $this->newline; - $body .= "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline; - $body .= $this->_get_alt_message() . $this->newline . $this->newline . "--" . $this->_alt_boundary . $this->newline; + . "Content-Type: text/plain; charset=" . $this->charset . $this->newline + . "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline + . $this->_get_alt_message() . $this->newline . $this->newline . "--" . $this->_alt_boundary . $this->newline - $body .= "Content-Type: text/html; charset=" . $this->charset . $this->newline; - $body .= "Content-Transfer-Encoding: quoted-printable" . $this->newline . $this->newline; + . "Content-Type: text/html; charset=" . $this->charset . $this->newline + . "Content-Transfer-Encoding: quoted-printable" . $this->newline . $this->newline; } $this->_finalbody = $body . $this->_prep_quoted_printable($this->_body) . $this->newline . $this->newline; - if ($this->_get_protocol() == 'mail') + if ($this->_get_protocol() === 'mail') { $this->_header_str .= $hdr; } @@ -1074,61 +1041,57 @@ class CI_Email { return; - break; case 'plain-attach' : $hdr .= "Content-Type: multipart/".$this->multipart."; boundary=\"" . $this->_atc_boundary."\"" . $this->newline . $this->newline; - if ($this->_get_protocol() == 'mail') + if ($this->_get_protocol() === 'mail') { $this->_header_str .= $hdr; } - $body .= $this->_get_mime_message() . $this->newline . $this->newline; - $body .= "--" . $this->_atc_boundary . $this->newline; + $body .= $this->_get_mime_message() . $this->newline . $this->newline + . "--" . $this->_atc_boundary . $this->newline - $body .= "Content-Type: text/plain; charset=" . $this->charset . $this->newline; - $body .= "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline; + . "Content-Type: text/plain; charset=" . $this->charset . $this->newline + . "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline - $body .= $this->_body . $this->newline . $this->newline; + . $this->_body . $this->newline . $this->newline; break; case 'html-attach' : $hdr .= "Content-Type: multipart/".$this->multipart."; boundary=\"" . $this->_atc_boundary."\"" . $this->newline . $this->newline; - if ($this->_get_protocol() == 'mail') + if ($this->_get_protocol() === 'mail') { $this->_header_str .= $hdr; } - $body .= $this->_get_mime_message() . $this->newline . $this->newline; - $body .= "--" . $this->_atc_boundary . $this->newline; + $body .= $this->_get_mime_message() . $this->newline . $this->newline + . "--" . $this->_atc_boundary . $this->newline - $body .= "Content-Type: multipart/alternative; boundary=\"" . $this->_alt_boundary . "\"" . $this->newline .$this->newline; - $body .= "--" . $this->_alt_boundary . $this->newline; + . "Content-Type: multipart/alternative; boundary=\"" . $this->_alt_boundary . "\"" . $this->newline .$this->newline + . "--" . $this->_alt_boundary . $this->newline - $body .= "Content-Type: text/plain; charset=" . $this->charset . $this->newline; - $body .= "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline; - $body .= $this->_get_alt_message() . $this->newline . $this->newline . "--" . $this->_alt_boundary . $this->newline; + . "Content-Type: text/plain; charset=" . $this->charset . $this->newline + . "Content-Transfer-Encoding: " . $this->_get_encoding() . $this->newline . $this->newline + . $this->_get_alt_message() . $this->newline . $this->newline . "--" . $this->_alt_boundary . $this->newline - $body .= "Content-Type: text/html; charset=" . $this->charset . $this->newline; - $body .= "Content-Transfer-Encoding: quoted-printable" . $this->newline . $this->newline; + . "Content-Type: text/html; charset=" . $this->charset . $this->newline + . "Content-Transfer-Encoding: quoted-printable" . $this->newline . $this->newline - $body .= $this->_prep_quoted_printable($this->_body) . $this->newline . $this->newline; - $body .= "--" . $this->_alt_boundary . "--" . $this->newline . $this->newline; + . $this->_prep_quoted_printable($this->_body) . $this->newline . $this->newline + . "--" . $this->_alt_boundary . "--" . $this->newline . $this->newline; break; } $attachment = array(); - - $z = 0; - - for ($i=0; $i < count($this->_attach_name); $i++) + for ($i = 0, $c = count($this->_attach_name), $z = 0; $i < $c; $i++) { - $filename = $this->_attach_name[$i]; - $basename = basename($filename); + $filename = $this->_attach_name[$i][0]; + $basename = (is_null($this->_attach_name[$i][1])) ? basename($filename) : $this->_attach_name[$i][1]; $ctype = $this->_attach_type[$i]; if ( ! file_exists($filename)) @@ -1137,13 +1100,12 @@ class CI_Email { return FALSE; } - $h = "--".$this->_atc_boundary.$this->newline; - $h .= "Content-type: ".$ctype."; "; - $h .= "name=\"".$basename."\"".$this->newline; - $h .= "Content-Disposition: ".$this->_attach_disp[$i].";".$this->newline; - $h .= "Content-Transfer-Encoding: base64".$this->newline; + $attachment[$z++] = "--".$this->_atc_boundary.$this->newline + . "Content-type: ".$ctype."; " + . "name=\"".$basename."\"".$this->newline + . "Content-Disposition: ".$this->_attach_disp[$i].";".$this->newline + . "Content-Transfer-Encoding: base64".$this->newline; - $attachment[$z++] = $h; $file = filesize($filename) +1; if ( ! $fp = fopen($filename, FOPEN_READ)) @@ -1157,17 +1119,7 @@ class CI_Email { } $body .= implode($this->newline, $attachment).$this->newline."--".$this->_atc_boundary."--"; - - - if ($this->_get_protocol() == 'mail') - { - $this->_finalbody = $body; - } - else - { - $this->_finalbody = $hdr . $body; - } - + $this->_finalbody = ($this->_get_protocol() === 'mail') ? $body : $hdr . $body; return; } @@ -1189,16 +1141,13 @@ class CI_Email { // Set the character limit // Don't allow over 76, as that will make servers and MUAs barf // all over quoted-printable data - if ($charlim == '' OR $charlim > '76') + if ($charlim == '' OR $charlim > 76) { - $charlim = '76'; + $charlim = 76; } - // Reduce multiple spaces - $str = preg_replace("| +|", " ", $str); - - // kill nulls - $str = preg_replace('/\x00+/', '', $str); + // Reduce multiple spaces & remove nulls + $str = preg_replace(array("| +|", '/\x00+/'), array(' ', ''), $str); // Standardize newlines if (strpos($str, "\r") !== FALSE) @@ -1210,13 +1159,10 @@ class CI_Email { // properly and MUAs will behave, so {unwrap} must go! $str = str_replace(array('{unwrap}', '{/unwrap}'), '', $str); - // Break into an array of lines - $lines = explode("\n", $str); - $escape = '='; $output = ''; - foreach ($lines as $line) + foreach (explode("\n", $str) as $line) { $length = strlen($line); $temp = ''; @@ -1227,17 +1173,15 @@ class CI_Email { for ($i = 0; $i < $length; $i++) { // Grab the next character - $char = substr($line, $i, 1); + $char = $line[$i]; $ascii = ord($char); // Convert spaces and tabs but only if it's the end of the line - if ($i == ($length - 1)) + if ($i === ($length - 1) && ($ascii === 32 OR $ascii === 9)) { - $char = ($ascii == '32' OR $ascii == '9') ? $escape.sprintf('%02s', dechex($ascii)) : $char; + $char = $escape.sprintf('%02s', dechex($ascii)); } - - // encode = signs - if ($ascii == '61') + elseif ($ascii === 61) // encode = signs { $char = $escape.strtoupper(sprintf('%02s', dechex($ascii))); // =3D } @@ -1300,7 +1244,7 @@ class CI_Email { for ($i = 0, $length = strlen($str); $i < $length; $i++) { // Grab the next character - $char = substr($str, $i, 1); + $char = $str[$i]; $ascii = ord($char); // convert ALL non-printable ASCII characters and our specials @@ -1310,7 +1254,7 @@ class CI_Email { } // handle regular spaces a bit more compactly than =20 - if ($ascii == 32) + if ($ascii === 32) { $char = '_'; } @@ -1361,22 +1305,14 @@ class CI_Email { $this->_build_headers(); - if ($this->bcc_batch_mode AND count($this->_bcc_array) > 0) + if ($this->bcc_batch_mode AND count($this->_bcc_array) > $this->bcc_batch_size) { - if (count($this->_bcc_array) > $this->bcc_batch_size) - return $this->batch_bcc_send(); + return $this->batch_bcc_send(); } $this->_build_message(); - if ( ! $this->_spool_email()) - { - return FALSE; - } - else - { - return TRUE; - } + return $this->_spool_email(); } // -------------------------------------------------------------------- @@ -1395,7 +1331,7 @@ class CI_Email { $chunk = array(); - for ($i = 0; $i < count($this->_bcc_array); $i++) + for ($i = 0, $c = count($this->_bcc_array); $i < $c; $i++) { if (isset($this->_bcc_array[$i])) { @@ -1405,25 +1341,23 @@ class CI_Email { if ($i == $float) { $chunk[] = substr($set, 1); - $float = $float + $this->bcc_batch_size; + $float += $this->bcc_batch_size; $set = ""; } - if ($i == count($this->_bcc_array)-1) + if ($i === $c-1) { $chunk[] = substr($set, 1); } } - for ($i = 0; $i < count($chunk); $i++) + for ($i = 0, $c = count($chunk); $i < $c; $i++) { unset($this->_headers['Bcc']); - unset($bcc); - $bcc = $this->_str_to_array($chunk[$i]); - $bcc = $this->clean_email($bcc); + $bcc = $this->clean_email($this->_str_to_array($chunk[$i])); - if ($this->protocol != 'smtp') + if ($this->protocol !== 'smtp') { $this->_set_header('Bcc', implode(", ", $bcc)); } @@ -1480,33 +1414,10 @@ class CI_Email { { $this->_unwrap_specials(); - switch ($this->_get_protocol()) + $method = '_send_with_' . $this->_get_protocol(); + if ( ! $this->$method()) { - case 'mail' : - - if ( ! $this->_send_with_mail()) - { - $this->_set_error_message('lang:email_send_failure_phpmail'); - return FALSE; - } - break; - case 'sendmail' : - - if ( ! $this->_send_with_sendmail()) - { - $this->_set_error_message('lang:email_send_failure_sendmail'); - return FALSE; - } - break; - case 'smtp' : - - if ( ! $this->_send_with_smtp()) - { - $this->_set_error_message('lang:email_send_failure_smtp'); - return FALSE; - } - break; - + $this->_set_error_message('lang:email_send_failure_' . ($this->_get_protocol() === 'mail' ? 'phpmail' : $this->_get_protocol())); } $this->_set_error_message('lang:email_sent', $this->_get_protocol()); @@ -1525,28 +1436,13 @@ class CI_Email { { if ($this->_safe_mode == TRUE) { - if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str)) - { - return FALSE; - } - else - { - return TRUE; - } + return mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str); } else { // most documentation of sendmail using the "-f" flag lacks a space after it, however // we've encountered servers that seem to require it to be in place. - - if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From']))) - { - return FALSE; - } - else - { - return TRUE; - } + return mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From'])); } } @@ -1573,12 +1469,7 @@ class CI_Email { $status = pclose($fp); - if (version_compare(PHP_VERSION, '4.2.3') == -1) - { - $status = $status >> 8 & 0xFF; - } - - if ($status != 0) + if ($status !== 0) { $this->_set_error_message('lang:email_exit_status', $status); $this->_set_error_message('lang:email_no_socket'); @@ -1647,7 +1538,7 @@ class CI_Email { $this->_set_error_message($reply); - if (strncmp($reply, '250', 3) != 0) + if (strncmp($reply, '250', 3) !== 0) { $this->_set_error_message('lang:email_smtp_error', $reply); return FALSE; @@ -1668,12 +1559,7 @@ class CI_Email { */ protected function _smtp_connect() { - $ssl = NULL; - - if ($this->smtp_crypto == 'ssl') - { - $ssl = 'ssl://'; - } + $ssl = ($this->smtp_crypto == 'ssl') ? 'ssl://' : NULL; $this->_smtp_connect = fsockopen($ssl.$this->smtp_host, $this->smtp_port, @@ -1693,13 +1579,14 @@ class CI_Email { { $this->_send_command('hello'); $this->_send_command('starttls'); + $crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT); - } - if ($crypto !== TRUE) - { - $this->_set_error_message('lang:email_smtp_error', $this->_get_smtp_data()); - return FALSE; + if ($crypto !== TRUE) + { + $this->_set_error_message('lang:email_smtp_error', $this->_get_smtp_data()); + return FALSE; + } } return $this->_send_command('hello'); @@ -1803,7 +1690,7 @@ class CI_Email { $reply = $this->_get_smtp_data(); - if (strncmp($reply, '334', 3) != 0) + if (strncmp($reply, '334', 3) !== 0) { $this->_set_error_message('lang:email_failed_smtp_login', $reply); return FALSE; @@ -1813,7 +1700,7 @@ class CI_Email { $reply = $this->_get_smtp_data(); - if (strncmp($reply, '334', 3) != 0) + if (strncmp($reply, '334', 3) !== 0) { $this->_set_error_message('lang:email_smtp_auth_un', $reply); return FALSE; @@ -1823,7 +1710,7 @@ class CI_Email { $reply = $this->_get_smtp_data(); - if (strncmp($reply, '235', 3) != 0) + if (strncmp($reply, '235', 3) !== 0) { $this->_set_error_message('lang:email_smtp_auth_pw', $reply); return FALSE; @@ -1847,10 +1734,8 @@ class CI_Email { $this->_set_error_message('lang:email_smtp_data_failure', $data); return FALSE; } - else - { - return TRUE; - } + + return TRUE; } // -------------------------------------------------------------------- @@ -1869,7 +1754,7 @@ class CI_Email { { $data .= $str; - if (substr($str, 3, 1) == " ") + if ($str[3] == " ") { break; } @@ -1908,12 +1793,16 @@ class CI_Email { $cip = (isset($_SERVER['HTTP_CLIENT_IP']) AND $_SERVER['HTTP_CLIENT_IP'] != "") ? $_SERVER['HTTP_CLIENT_IP'] : FALSE; $rip = (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR'] != "") ? $_SERVER['REMOTE_ADDR'] : FALSE; - $fip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] != "") ? $_SERVER['HTTP_X_FORWARDED_FOR'] : FALSE; - - if ($cip && $rip) $this->_IP = $cip; - elseif ($rip) $this->_IP = $rip; - elseif ($cip) $this->_IP = $cip; - elseif ($fip) $this->_IP = $fip; + if ($cip) $this->_IP = $cip; + elseif ($rip) $this->_IP = $rip; + else + { + $fip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] != "") ? $_SERVER['HTTP_X_FORWARDED_FOR'] : FALSE; + if ($fip) + { + $this->_IP = $fip; + } + } if (strpos($this->_IP, ',') !== FALSE) { @@ -1926,10 +1815,6 @@ class CI_Email { $this->_IP = '0.0.0.0'; } - unset($cip); - unset($rip); - unset($fip); - return $this->_IP; } @@ -1971,7 +1856,7 @@ class CI_Email { $CI =& get_instance(); $CI->lang->load('email'); - if (substr($msg, 0, 5) != 'lang:' || FALSE === ($line = $CI->lang->line(substr($msg, 5)))) + if (substr($msg, 0, 5) !== 'lang:' || FALSE === ($line = $CI->lang->line(substr($msg, 5)))) { $this->_debug_msg[] = str_replace('%s', $val, $msg)."<br />"; } diff --git a/system/libraries/Encrypt.php b/system/libraries/Encrypt.php index b30a8cf0b..c2cb808dd 100644 --- a/system/libraries/Encrypt.php +++ b/system/libraries/Encrypt.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/encryption.html */ class CI_Encrypt { diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index c78583f4f..3f5323233 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Validation - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/form_validation.html */ class CI_Form_validation { @@ -734,7 +746,7 @@ class CI_Form_validation { } // If the data is an array output them one at a time. - // E.g: form_input('name[]', set_value('name[]'); + // E.g: form_input('name[]', set_value('name[]'); if (is_array($this->_field_data[$field]['postdata'])) { return array_shift($this->_field_data[$field]['postdata']); @@ -937,7 +949,7 @@ class CI_Form_validation { return ($str !== $field) ? FALSE : TRUE; } - + // -------------------------------------------------------------------- /** @@ -950,11 +962,14 @@ class CI_Form_validation { */ public function is_unique($str, $field) { - list($table, $field)=explode('.', $field); - $query = $this->CI->db->limit(1)->get_where($table, array($field => $str)); - - return $query->num_rows() === 0; - } + list($table, $field) = explode('.', $field); + if (isset($this->CI->db)) + { + $query = $this->CI->db->limit(1)->get_where($table, array($field => $str)); + return $query->num_rows() === 0; + } + return FALSE; + } // -------------------------------------------------------------------- diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index d7a8b3b02..99850a9e5 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,18 +33,18 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/ftp.html */ class CI_FTP { - var $hostname = ''; - var $username = ''; - var $password = ''; - var $port = 21; - var $passive = TRUE; - var $debug = FALSE; - var $conn_id = FALSE; + public $hostname = ''; + public $username = ''; + public $password = ''; + public $port = 21; + public $passive = TRUE; + public $debug = FALSE; + public $conn_id = FALSE; /** @@ -59,7 +71,7 @@ class CI_FTP { * @param array * @return void */ - function initialize($config = array()) + public function initialize($config = array()) { foreach ($config as $key => $val) { @@ -82,7 +94,7 @@ class CI_FTP { * @param array the connection values * @return bool */ - function connect($config = array()) + public function connect($config = array()) { if (count($config) > 0) { @@ -124,7 +136,7 @@ class CI_FTP { * @access private * @return bool */ - function _login() + private function _login() { return @ftp_login($this->conn_id, $this->username, $this->password); } @@ -137,7 +149,7 @@ class CI_FTP { * @access private * @return bool */ - function _is_conn() + private function _is_conn() { if ( ! is_resource($this->conn_id)) { @@ -167,7 +179,7 @@ class CI_FTP { * @param bool * @return bool */ - function changedir($path = '', $supress_debug = FALSE) + public function changedir($path = '', $supress_debug = FALSE) { if ($path == '' OR ! $this->_is_conn()) { @@ -197,7 +209,7 @@ class CI_FTP { * @param string * @return bool */ - function mkdir($path = '', $permissions = NULL) + public function mkdir($path = '', $permissions = NULL) { if ($path == '' OR ! $this->_is_conn()) { @@ -235,7 +247,7 @@ class CI_FTP { * @param string * @return bool */ - function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL) + public function upload($locpath, $rempath, $mode = 'auto', $permissions = NULL) { if ( ! $this->_is_conn()) { @@ -249,14 +261,14 @@ class CI_FTP { } // Set the mode if not specified - if ($mode == 'auto') + if ($mode === 'auto') { // Get the file extension so we can set the upload type $ext = $this->_getext($locpath); $mode = $this->_settype($ext); } - $mode = ($mode == 'ascii') ? FTP_ASCII : FTP_BINARY; + $mode = ($mode === 'ascii') ? FTP_ASCII : FTP_BINARY; $result = @ftp_put($this->conn_id, $rempath, $locpath, $mode); @@ -289,7 +301,7 @@ class CI_FTP { * @param string * @return bool */ - function download($rempath, $locpath, $mode = 'auto') + public function download($rempath, $locpath, $mode = 'auto') { if ( ! $this->_is_conn()) { @@ -297,14 +309,14 @@ class CI_FTP { } // Set the mode if not specified - if ($mode == 'auto') + if ($mode === 'auto') { // Get the file extension so we can set the upload type $ext = $this->_getext($rempath); $mode = $this->_settype($ext); } - $mode = ($mode == 'ascii') ? FTP_ASCII : FTP_BINARY; + $mode = ($mode === 'ascii') ? FTP_ASCII : FTP_BINARY; $result = @ftp_get($this->conn_id, $locpath, $rempath, $mode); @@ -331,7 +343,7 @@ class CI_FTP { * @param bool * @return bool */ - function rename($old_file, $new_file, $move = FALSE) + public function rename($old_file, $new_file, $move = FALSE) { if ( ! $this->_is_conn()) { @@ -344,9 +356,7 @@ class CI_FTP { { if ($this->debug == TRUE) { - $msg = ($move == FALSE) ? 'ftp_unable_to_rename' : 'ftp_unable_to_move'; - - $this->_error($msg); + $this->_error('ftp_unable_to_' . ($move == FALSE ? 'rename' : 'move')); } return FALSE; } @@ -364,7 +374,7 @@ class CI_FTP { * @param string * @return bool */ - function move($old_file, $new_file) + public function move($old_file, $new_file) { return $this->rename($old_file, $new_file, TRUE); } @@ -378,7 +388,7 @@ class CI_FTP { * @param string * @return bool */ - function delete_file($filepath) + public function delete_file($filepath) { if ( ! $this->_is_conn()) { @@ -409,7 +419,7 @@ class CI_FTP { * @param string * @return bool */ - function delete_dir($filepath) + public function delete_dir($filepath) { if ( ! $this->_is_conn()) { @@ -458,23 +468,13 @@ class CI_FTP { * @param string the permissions * @return bool */ - function chmod($path, $perm) + public function chmod($path, $perm) { if ( ! $this->_is_conn()) { return FALSE; } - // Permissions can only be set when running PHP 5 - if ( ! function_exists('ftp_chmod')) - { - if ($this->debug == TRUE) - { - $this->_error('ftp_unable_to_chmod'); - } - return FALSE; - } - $result = @ftp_chmod($this->conn_id, $perm, $path); if ($result === FALSE) @@ -497,7 +497,7 @@ class CI_FTP { * @access public * @return array */ - function list_files($path = '.') + public function list_files($path = '.') { if ( ! $this->_is_conn()) { @@ -521,7 +521,7 @@ class CI_FTP { * @param string path to destination - include the base folder with trailing slash * @return bool */ - function mirror($locpath, $rempath) + public function mirror($locpath, $rempath) { if ( ! $this->_is_conn()) { @@ -531,24 +531,20 @@ class CI_FTP { // Open the local file path if ($fp = @opendir($locpath)) { - // Attempt to open the remote file path. - if ( ! $this->changedir($rempath, TRUE)) + // Attempt to open the remote file path and try to create it, if it doesn't exist + if ( ! $this->changedir($rempath, TRUE) AND ( ! $this->mkdir($rempath) OR ! $this->changedir($rempath))) { - // If it doesn't exist we'll attempt to create the direcotory - if ( ! $this->mkdir($rempath) OR ! $this->changedir($rempath)) - { - return FALSE; - } + return FALSE; } // Recursively read the local directory while (FALSE !== ($file = readdir($fp))) { - if (@is_dir($locpath.$file) && substr($file, 0, 1) != '.') + if (@is_dir($locpath.$file) && $file[0] !== '.') { $this->mirror($locpath.$file."/", $rempath.$file."/"); } - elseif (substr($file, 0, 1) != ".") + elseif ($file[0] !== ".") { // Get the file extension so we can se the upload type $ext = $this->_getext($file); @@ -573,7 +569,7 @@ class CI_FTP { * @param string * @return string */ - function _getext($filename) + private function _getext($filename) { if (FALSE === strpos($filename, '.')) { @@ -594,7 +590,7 @@ class CI_FTP { * @param string * @return string */ - function _settype($ext) + private function _settype($ext) { $text_types = array( 'txt', @@ -622,18 +618,16 @@ class CI_FTP { * Close the connection * * @access public - * @param string path to source - * @param string path to destination * @return bool */ - function close() + public function close() { if ( ! $this->_is_conn()) { return FALSE; } - @ftp_close($this->conn_id); + return @ftp_close($this->conn_id); } // ------------------------------------------------------------------------ @@ -643,9 +637,9 @@ class CI_FTP { * * @access private * @param string - * @return bool + * @return void */ - function _error($line) + private function _error($line) { $CI =& get_instance(); $CI->lang->load('ftp'); @@ -657,4 +651,4 @@ class CI_FTP { // END FTP Class /* End of file Ftp.php */ -/* Location: ./system/libraries/Ftp.php */
\ No newline at end of file +/* Location: ./system/libraries/Ftp.php */ diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index a8a0387d8..20ca1f055 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,60 +33,60 @@ * @package CodeIgniter * @subpackage Libraries * @category Image_lib - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/image_lib.html */ class CI_Image_lib { - var $image_library = 'gd2'; // Can be: imagemagick, netpbm, gd, gd2 - var $library_path = ''; - var $dynamic_output = FALSE; // Whether to send to browser or write to disk - var $source_image = ''; - var $new_image = ''; - var $width = ''; - var $height = ''; - var $quality = '90'; - var $create_thumb = FALSE; - var $thumb_marker = '_thumb'; - var $maintain_ratio = TRUE; // Whether to maintain aspect ratio when resizing or use hard values - var $master_dim = 'auto'; // auto, height, or width. Determines what to use as the master dimension - var $rotation_angle = ''; - var $x_axis = ''; - var $y_axis = ''; + public $image_library = 'gd2'; // Can be: imagemagick, netpbm, gd, gd2 + public $library_path = ''; + public $dynamic_output = FALSE; // Whether to send to browser or write to disk + public $source_image = ''; + public $new_image = ''; + public $width = ''; + public $height = ''; + public $quality = '90'; + public $create_thumb = FALSE; + public $thumb_marker = '_thumb'; + public $maintain_ratio = TRUE; // Whether to maintain aspect ratio when resizing or use hard values + public $master_dim = 'auto'; // auto, height, or width. Determines what to use as the master dimension + public $rotation_angle = ''; + public $x_axis = ''; + public $y_axis = ''; // Watermark Vars - var $wm_text = ''; // Watermark text if graphic is not used - var $wm_type = 'text'; // Type of watermarking. Options: text/overlay - var $wm_x_transp = 4; - var $wm_y_transp = 4; - var $wm_overlay_path = ''; // Watermark image path - var $wm_font_path = ''; // TT font - var $wm_font_size = 17; // Font size (different versions of GD will either use points or pixels) - var $wm_vrt_alignment = 'B'; // Vertical alignment: T M B - var $wm_hor_alignment = 'C'; // Horizontal alignment: L R C - var $wm_padding = 0; // Padding around text - var $wm_hor_offset = 0; // Lets you push text to the right - var $wm_vrt_offset = 0; // Lets you push text down - var $wm_font_color = '#ffffff'; // Text color - var $wm_shadow_color = ''; // Dropshadow color - var $wm_shadow_distance = 2; // Dropshadow distance - var $wm_opacity = 50; // Image opacity: 1 - 100 Only works with image + public $wm_text = ''; // Watermark text if graphic is not used + public $wm_type = 'text'; // Type of watermarking. Options: text/overlay + public $wm_x_transp = 4; + public $wm_y_transp = 4; + public $wm_overlay_path = ''; // Watermark image path + public $wm_font_path = ''; // TT font + public $wm_font_size = 17; // Font size (different versions of GD will either use points or pixels) + public $wm_vrt_alignment = 'B'; // Vertical alignment: T M B + public $wm_hor_alignment = 'C'; // Horizontal alignment: L R C + public $wm_padding = 0; // Padding around text + public $wm_hor_offset = 0; // Lets you push text to the right + public $wm_vrt_offset = 0; // Lets you push text down + public $wm_font_color = '#ffffff'; // Text color + public $wm_shadow_color = ''; // Dropshadow color + public $wm_shadow_distance = 2; // Dropshadow distance + public $wm_opacity = 50; // Image opacity: 1 - 100 Only works with image // Private Vars - var $source_folder = ''; - var $dest_folder = ''; - var $mime_type = ''; - var $orig_width = ''; - var $orig_height = ''; - var $image_type = ''; - var $size_str = ''; - var $full_src_path = ''; - var $full_dst_path = ''; - var $create_fnc = 'imagecreatetruecolor'; - var $copy_fnc = 'imagecopyresampled'; - var $error_msg = array(); - var $wm_use_drop_shadow = FALSE; - var $wm_use_truetype = FALSE; + public $source_folder = ''; + public $dest_folder = ''; + public $mime_type = ''; + public $orig_width = ''; + public $orig_height = ''; + public $image_type = ''; + public $size_str = ''; + public $full_src_path = ''; + public $full_dst_path = ''; + public $create_fnc = 'imagecreatetruecolor'; + public $copy_fnc = 'imagecopyresampled'; + public $error_msg = array(); + public $wm_use_drop_shadow = FALSE; + public $wm_use_truetype = FALSE; /** * Constructor @@ -102,17 +114,39 @@ class CI_Image_lib { * @access public * @return void */ - function clear() + public function clear() { - $props = array('source_folder', 'dest_folder', 'source_image', 'full_src_path', 'full_dst_path', 'new_image', 'image_type', 'size_str', 'quality', 'orig_width', 'orig_height', 'rotation_angle', 'x_axis', 'y_axis', 'create_fnc', 'copy_fnc', 'wm_overlay_path', 'wm_use_truetype', 'dynamic_output', 'wm_font_size', 'wm_text', 'wm_vrt_alignment', 'wm_hor_alignment', 'wm_padding', 'wm_hor_offset', 'wm_vrt_offset', 'wm_font_color', 'wm_use_drop_shadow', 'wm_shadow_color', 'wm_shadow_distance', 'wm_opacity'); + $props = array('library_path', 'source_image', 'new_image', 'width', 'height', 'rotation_angle', 'x_axis', 'y_axis', 'wm_text', 'wm_overlay_path', 'wm_font_path', 'wm_shadow_color', 'source_folder', 'dest_folder', 'mime_type', 'orig_width', 'orig_height', 'image_type', 'size_str', 'full_src_path', 'full_dst_path'); foreach ($props as $val) { $this->$val = ''; } - // special consideration for master_dim - $this->master_dim = 'auto'; + $this->image_library = 'gd2'; + $this->dynamic_output = FALSE; + $this->quality = '90'; + $this->create_thumb = FALSE; + $this->thumb_marker = '_thumb'; + $this->maintain_ratio = TRUE; + $this->master_dim = 'auto'; + $this->wm_type = 'text'; + $this->wm_x_transp = 4; + $this->wm_y_transp = 4; + $this->wm_font_size = 17; + $this->wm_vrt_alignment = 'B'; + $this->wm_hor_alignment = 'C'; + $this->wm_padding = 0; + $this->wm_hor_offset = 0; + $this->wm_vrt_offset = 0; + $this->wm_font_color = '#ffffff'; + $this->wm_shadow_distance = 2; + $this->wm_opacity = 50; + $this->create_fnc = 'imagecreatetruecolor'; + $this->copy_fnc = 'imagecopyresampled'; + $this->error_msg = array(); + $this->wm_use_drop_shadow = FALSE; + $this->wm_use_truetype = FALSE; } // -------------------------------------------------------------------- @@ -124,7 +158,7 @@ class CI_Image_lib { * @param array * @return bool */ - function initialize($props = array()) + public function initialize($props = array()) { /* * Convert array elements into class variables @@ -146,7 +180,7 @@ class CI_Image_lib { if ($this->source_image == '') { $this->set_error('imglib_source_image_required'); - return FALSE; + return FALSE; } /* @@ -189,7 +223,7 @@ class CI_Image_lib { // Set the Image Properties if ( ! $this->get_image_properties($this->source_folder.$this->source_image)) { - return FALSE; + return FALSE; } /* @@ -345,7 +379,7 @@ class CI_Image_lib { * @access public * @return bool */ - function resize() + public function resize() { $protocol = 'image_process_'.$this->image_library; @@ -368,7 +402,7 @@ class CI_Image_lib { * @access public * @return bool */ - function crop() + public function crop() { $protocol = 'image_process_'.$this->image_library; @@ -391,7 +425,7 @@ class CI_Image_lib { * @access public * @return bool */ - function rotate() + public function rotate() { // Allowed rotation values $degs = array(90, 180, 270, 'vrt', 'hor'); @@ -399,7 +433,7 @@ class CI_Image_lib { if ($this->rotation_angle == '' OR ! in_array($this->rotation_angle, $degs)) { $this->set_error('imglib_rotation_angle_required'); - return FALSE; + return FALSE; } // Reassign the width and height @@ -444,7 +478,7 @@ class CI_Image_lib { * @param string * @return bool */ - function image_process_gd($action = 'resize') + public function image_process_gd($action = 'resize') { $v2_override = FALSE; @@ -556,7 +590,7 @@ class CI_Image_lib { * @param string * @return bool */ - function image_process_imagemagick($action = 'resize') + public function image_process_imagemagick($action = 'resize') { // Do we have a vaild library path? if ($this->library_path == '') @@ -626,7 +660,7 @@ class CI_Image_lib { * @param string * @return bool */ - function image_process_netpbm($action = 'resize') + public function image_process_netpbm($action = 'resize') { if ($this->library_path == '') { @@ -709,7 +743,7 @@ class CI_Image_lib { * @access public * @return bool */ - function image_rotate_gd() + public function image_rotate_gd() { // Create the image handle if ( ! ($src_img = $this->image_create_gd())) @@ -762,7 +796,7 @@ class CI_Image_lib { * @access public * @return bool */ - function image_mirror_gd() + public function image_mirror_gd() { if ( ! $src_img = $this->image_create_gd()) { @@ -848,7 +882,7 @@ class CI_Image_lib { * @param string * @return bool */ - function watermark() + public function watermark() { if ($this->wm_type == 'overlay') { @@ -868,7 +902,7 @@ class CI_Image_lib { * @access public * @return bool */ - function overlay_watermark() + public function overlay_watermark() { if ( ! function_exists('imagecolortransparent')) { @@ -981,7 +1015,7 @@ class CI_Image_lib { * @access public * @return bool */ - function text_watermark() + public function text_watermark() { if ( ! ($src_img = $this->image_create_gd())) { @@ -1125,7 +1159,7 @@ class CI_Image_lib { * @param string * @return resource */ - function image_create_gd($path = '', $image_type = '') + public function image_create_gd($path = '', $image_type = '') { if ($path == '') $path = $this->full_src_path; @@ -1182,7 +1216,7 @@ class CI_Image_lib { * @param resource * @return bool */ - function image_save_gd($resource) + public function image_save_gd($resource) { switch ($this->image_type) { @@ -1243,7 +1277,7 @@ class CI_Image_lib { * @param resource * @return void */ - function image_display_gd($resource) + public function image_display_gd($resource) { header("Content-Disposition: filename={$this->source_image};"); header("Content-Type: {$this->mime_type}"); @@ -1278,7 +1312,7 @@ class CI_Image_lib { * @access public * @return void */ - function image_reproportion() + public function image_reproportion() { if ( ! is_numeric($this->width) OR ! is_numeric($this->height) OR $this->width == 0 OR $this->height == 0) return; @@ -1320,7 +1354,7 @@ class CI_Image_lib { * @param string * @return mixed */ - function get_image_properties($path = '', $return = FALSE) + public function get_image_properties($path = '', $return = FALSE) { // For now we require GD but we should // find a way to determine this using IM or NetPBM @@ -1380,7 +1414,7 @@ class CI_Image_lib { * @param array * @return array */ - function size_calculator($vals) + public function size_calculator($vals) { if ( ! is_array($vals)) { @@ -1428,7 +1462,7 @@ class CI_Image_lib { * @param array * @return array */ - function explode_name($source_image) + public function explode_name($source_image) { $ext = strrchr($source_image, '.'); $name = ($ext === FALSE) ? $source_image : substr($source_image, 0, -strlen($ext)); @@ -1444,7 +1478,7 @@ class CI_Image_lib { * @access public * @return bool */ - function gd_loaded() + public function gd_loaded() { if ( ! extension_loaded('gd')) { @@ -1465,7 +1499,7 @@ class CI_Image_lib { * @access public * @return mixed */ - function gd_version() + public function gd_version() { if (function_exists('gd_info')) { @@ -1487,7 +1521,7 @@ class CI_Image_lib { * @param string * @return void */ - function set_error($msg) + public function set_error($msg) { $CI =& get_instance(); $CI->lang->load('imglib'); @@ -1519,19 +1553,13 @@ class CI_Image_lib { * @param string * @return string */ - function display_errors($open = '<p>', $close = '</p>') + public function display_errors($open = '<p>', $close = '</p>') { - $str = ''; - foreach ($this->error_msg as $val) - { - $str .= $open.$val.$close; - } - - return $str; + return (count($this->error_msg) > 0) ? $open . implode($close . $open, $this->error_msg) . $close : ''; } } // END Image_lib Class /* End of file Image_lib.php */ -/* Location: ./system/libraries/Image_lib.php */
\ No newline at end of file +/* Location: ./system/libraries/Image_lib.php */ diff --git a/system/libraries/Javascript.php b/system/libraries/Javascript.php index 34e0d7001..15887cb95 100644 --- a/system/libraries/Javascript.php +++ b/system/libraries/Javascript.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Javascript - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/javascript.html */ class CI_Javascript { diff --git a/system/libraries/Log.php b/system/libraries/Log.php index bf10d4727..7f3a307f3 100644 --- a/system/libraries/Log.php +++ b/system/libraries/Log.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Logging - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/general/errors.html */ class CI_Log { @@ -32,7 +44,7 @@ class CI_Log { protected $_threshold_array = array(); protected $_date_fmt = 'Y-m-d H:i:s'; protected $_enabled = TRUE; - protected $_levels = array('ERROR' => '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4'); + protected $_levels = array('ERROR' => 1, 'DEBUG' => 2, 'INFO' => 3, 'ALL' => 4); /** * Constructor @@ -50,7 +62,7 @@ class CI_Log { if (is_numeric($config['log_threshold'])) { - $this->_threshold = $config['log_threshold']; + $this->_threshold = (int) $config['log_threshold']; } elseif (is_array($config['log_threshold'])) { @@ -85,12 +97,10 @@ class CI_Log { $level = strtoupper($level); - if ( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold)) + if (( ! isset($this->_levels[$level]) OR ($this->_levels[$level] > $this->_threshold)) + AND ! isset($this->_threshold_array[$this->_levels[$level]])) { - if (empty($this->_threshold_array) OR ! isset($this->_threshold_array[$this->_levels[$level]])) - { - return FALSE; - } + return FALSE; } @@ -99,7 +109,8 @@ class CI_Log { if ( ! file_exists($filepath)) { - $message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; + $newfile = TRUE; + $message .= "<"."?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?".">\n\n"; } if ( ! $fp = @fopen($filepath, FOPEN_WRITE_CREATE)) @@ -114,7 +125,10 @@ class CI_Log { flock($fp, LOCK_UN); fclose($fp); - @chmod($filepath, FILE_WRITE_MODE); + if (isset($newfile) AND $newfile === TRUE) + { + @chmod($filepath, FILE_WRITE_MODE); + } return TRUE; } @@ -122,4 +136,4 @@ class CI_Log { // END Log Class /* End of file Log.php */ -/* Location: ./system/libraries/Log.php */
\ No newline at end of file +/* Location: ./system/libraries/Log.php */ diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index 840cefe08..eb5161d76 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -1,15 +1,27 @@ -<?php defined('BASEPATH') OR exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter * @author EllisLab Dev Team - * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @copyright Copyright (c) 2006 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com - * @since Version 1.0 + * @since Version 3.0 * @filesource */ @@ -34,7 +46,7 @@ class CI_Migration { protected $_migration_version = 0; protected $_migration_table = 'migrations'; protected $_migration_auto_latest = FALSE; - + protected $_error_string = ''; public function __construct($config = array()) @@ -59,7 +71,7 @@ class CI_Migration { } // If not set, set it - $this->_migration_path == '' AND $this->_migration_path = APPPATH . 'migrations/'; + $this->_migration_path == '' AND $this->_migration_path = APPPATH.'migrations/'; // Add trailing slash if not set $this->_migration_path = rtrim($this->_migration_path, '/').'/'; @@ -73,7 +85,7 @@ class CI_Migration { // Make sure the migration table name was set. if (empty($this->_migration_table)) { - show_error('Migrations configuration file (migration.php) must have "migration_table" set.'); + show_error('Migrations configuration file (migration.php) must have "migration_table" set.'); } // If the migrations table is missing, make it @@ -87,14 +99,11 @@ class CI_Migration { $this->db->insert($this->_migration_table, array('version' => 0)); } - + // Do we auto migrate to the latest migration? - if ( $this->_migration_auto_latest == TRUE ) + if ($this->_migration_auto_latest === TRUE AND ! $this->latest()) { - if ( ! $this->latest() ) - { - show_error($this->error_string()); - } + show_error($this->error_string()); } } @@ -122,13 +131,12 @@ class CI_Migration { ++$stop; $step = 1; } - else { // Moving Down $step = -1; } - + $method = $step === 1 ? 'up' : 'down'; $migrations = array(); @@ -136,7 +144,7 @@ class CI_Migration { // But first let's make sure that everything is the way it should be for ($i = $start; $i != $stop; $i += $step) { - $f = glob(sprintf($this->_migration_path . '%03d_*.php', $i)); + $f = glob(sprintf($this->_migration_path.'%03d_*.php', $i)); // Only one migration per step is permitted if (count($f) > 1) @@ -146,11 +154,11 @@ class CI_Migration { } // Migration step not found - if (count($f) == 0) + if (count($f) === 0) { // If trying to migrate up to a version greater than the last // existing one, migrate to the last one. - if ($step == 1) + if ($step === 1) { break; } @@ -177,7 +185,7 @@ class CI_Migration { } include $f[0]; - $class = 'Migration_' . ucfirst($match[1]); + $class = 'Migration_'.ucfirst($match[1]); if ( ! class_exists($class)) { @@ -200,9 +208,9 @@ class CI_Migration { } } - log_message('debug', 'Current migration: ' . $current_version); + log_message('debug', 'Current migration: '.$current_version); - $version = $i + ($step == 1 ? -1 : 0); + $version = $i + ($step === 1 ? -1 : 0); // If there is nothing to do so quit if ($migrations === array()) @@ -210,13 +218,13 @@ class CI_Migration { return TRUE; } - log_message('debug', 'Migrating from ' . $method . ' to version ' . $version); + log_message('debug', 'Migrating from '.$method.' to version '.$version); // Loop through the migrations foreach ($migrations AS $migration) { // Run the migration class - $class = 'Migration_' . ucfirst(strtolower($migration)); + $class = 'Migration_'.ucfirst(strtolower($migration)); call_user_func(array(new $class, $method)); $current_version += $step; @@ -240,12 +248,12 @@ class CI_Migration { { if ( ! $migrations = $this->find_migrations()) { - $this->_error_string = $this->line->lang('migration_none_found'); + $this->_error_string = $this->lang->line('migration_none_found'); return false; } $last_migration = basename(end($migrations)); - + // Calculate the last migration step from existing migration // filenames and procceed to the standard version migration return $this->version((int) substr($last_migration, 0, 3)); @@ -288,19 +296,17 @@ class CI_Migration { protected function find_migrations() { // Load all *_*.php files in the migrations path - $files = glob($this->_migration_path . '*_*.php'); - $file_count = count($files); - - for ($i = 0; $i < $file_count; $i++) + $files = glob($this->_migration_path.'*_*.php'); + + for ($i = 0, $c = count($files); $i < $c; $i++) { // Mark wrongly formatted files as false for later filtering - $name = basename($files[$i], '.php'); - if ( ! preg_match('/^\d{3}_(\w+)$/', $name)) + if ( ! preg_match('/^\d{3}_(\w+)$/', basename($files[$i], '.php'))) { $files[$i] = FALSE; } } - + sort($files); return $files; @@ -352,4 +358,4 @@ class CI_Migration { } /* End of file Migration.php */ -/* Location: ./system/libraries/Migration.php */
\ No newline at end of file +/* Location: ./system/libraries/Migration.php */ diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index eff754a1b..eea953ae4 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,44 +33,43 @@ * @package CodeIgniter * @subpackage Libraries * @category Pagination - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/pagination.html */ class CI_Pagination { - var $base_url = ''; // The page we are linking to - var $prefix = ''; // A custom prefix added to the path. - var $suffix = ''; // A custom suffix added to the path. - - var $total_rows = 0; // Total number of items (database results) - var $per_page = 10; // Max number of items you want shown per page - var $num_links = 2; // Number of "digit" links to show before/after the currently viewed page - var $cur_page = 0; // The current page being viewed - var $use_page_numbers = FALSE; // Use page number for segment instead of offset - var $first_link = '‹ First'; - var $next_link = '>'; - var $prev_link = '<'; - var $last_link = 'Last ›'; - var $uri_segment = 3; - var $full_tag_open = ''; - var $full_tag_close = ''; - var $first_tag_open = ''; - var $first_tag_close = ' '; - var $last_tag_open = ' '; - var $last_tag_close = ''; - var $first_url = ''; // Alternative URL for the First Page. - var $cur_tag_open = ' <strong>'; - var $cur_tag_close = '</strong>'; - var $next_tag_open = ' '; - var $next_tag_close = ' '; - var $prev_tag_open = ' '; - var $prev_tag_close = ''; - var $num_tag_open = ' '; - var $num_tag_close = ''; - var $page_query_string = FALSE; - var $query_string_segment = 'per_page'; - var $display_pages = TRUE; - var $anchor_class = ''; + protected $base_url = ''; // The page we are linking to + protected $prefix = ''; // A custom prefix added to the path. + protected $suffix = ''; // A custom suffix added to the path. + protected $total_rows = 0; // Total number of items (database results) + protected $per_page = 10; // Max number of items you want shown per page + protected $num_links = 2; // Number of "digit" links to show before/after the currently viewed page + protected $cur_page = 0; // The current page being viewed + protected $use_page_numbers = FALSE; // Use page number for segment instead of offset + protected $first_link = '‹ First'; + protected $next_link = '>'; + protected $prev_link = '<'; + protected $last_link = 'Last ›'; + protected $uri_segment = 3; + protected $full_tag_open = ''; + protected $full_tag_close = ''; + protected $first_tag_open = ''; + protected $first_tag_close = ' '; + protected $last_tag_open = ' '; + protected $last_tag_close = ''; + protected $first_url = ''; // Alternative URL for the First Page. + protected $cur_tag_open = ' <strong>'; + protected $cur_tag_close = '</strong>'; + protected $next_tag_open = ' '; + protected $next_tag_close = ' '; + protected $prev_tag_open = ' '; + protected $prev_tag_close = ''; + protected $num_tag_open = ' '; + protected $num_tag_close = ''; + protected $page_query_string = FALSE; + protected $query_string_segment = 'per_page'; + protected $display_pages = TRUE; + protected $anchor_class = ''; /** * Constructor @@ -68,16 +79,7 @@ class CI_Pagination { */ public function __construct($params = array()) { - if (count($params) > 0) - { - $this->initialize($params); - } - - if ($this->anchor_class != '') - { - $this->anchor_class = 'class="'.$this->anchor_class.'" '; - } - + $this->initialize($params); log_message('debug', "Pagination Class Initialized"); } @@ -90,7 +92,7 @@ class CI_Pagination { * @param array initialization parameters * @return void */ - function initialize($params = array()) + public function initialize($params = array()) { if (count($params) > 0) { @@ -102,6 +104,11 @@ class CI_Pagination { } } } + + if ($this->anchor_class != '') + { + $this->anchor_class = 'class="'.$this->anchor_class.'" '; + } } // -------------------------------------------------------------------- @@ -112,7 +119,7 @@ class CI_Pagination { * @access public * @return string */ - function create_links() + public function create_links() { // If our item count or per-page total is zero there is no need to continue. if ($this->total_rows == 0 OR $this->per_page == 0) @@ -155,7 +162,7 @@ class CI_Pagination { $this->cur_page = (int) $this->cur_page; } } - + // Set current page to 1 if using page numbers instead of offset if ($this->use_page_numbers AND $this->cur_page == 0) { @@ -192,7 +199,7 @@ class CI_Pagination { } $uri_page_number = $this->cur_page; - + if ( ! $this->use_page_numbers) { $this->cur_page = floor(($this->cur_page/$this->per_page) + 1); @@ -286,11 +293,11 @@ class CI_Pagination { if ($this->last_link !== FALSE AND ($this->cur_page + $this->num_links) < $num_pages) { $i = ($this->use_page_numbers) ? $num_pages : ($num_pages * $this->per_page) - $this->per_page; - + $output .= $this->last_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$this->prefix.$i.$this->suffix.'">'.$this->last_link.'</a>'.$this->last_tag_close; } - // Kill double slashes. Note: Sometimes we can end up with a double slash + // Kill double slashes. Note: Sometimes we can end up with a double slash // in the penultimate link so we'll kill all double slashes. $output = preg_replace("#([^:])//+#", "\\1/", $output); diff --git a/system/libraries/Parser.php b/system/libraries/Parser.php index d223da020..39aa61e45 100644 --- a/system/libraries/Parser.php +++ b/system/libraries/Parser.php @@ -1,13 +1,25 @@ -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); +<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** * CodeIgniter * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,14 +33,15 @@ * @package CodeIgniter * @subpackage Libraries * @category Parser - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/parser.html */ class CI_Parser { - var $l_delim = '{'; - var $r_delim = '}'; - var $object; + public $l_delim = '{'; + public $r_delim = '}'; + public $object; + private $CI; /** * Parse a template @@ -44,8 +57,8 @@ class CI_Parser { */ public function parse($template, $data, $return = FALSE) { - $CI =& get_instance(); - $template = $CI->load->view($template, $data, TRUE); + $this->CI =& get_instance(); + $template = $this->CI->load->view($template, $data, TRUE); return $this->_parse($template, $data, $return); } @@ -64,7 +77,7 @@ class CI_Parser { * @param bool * @return string */ - function parse_string($template, $data, $return = FALSE) + public function parse_string($template, $data, $return = FALSE) { return $this->_parse($template, $data, $return); } @@ -77,13 +90,13 @@ class CI_Parser { * Parses pseudo-variables contained in the specified template, * replacing them with the data in the second param * - * @access public + * @access private * @param string * @param array * @param bool * @return string */ - function _parse($template, $data, $return = FALSE) + private function _parse($template, $data, $return = FALSE) { if ($template == '') { @@ -104,8 +117,7 @@ class CI_Parser { if ($return == FALSE) { - $CI =& get_instance(); - $CI->output->append_output($template); + $this->CI->output->append_output($template); } return $template; @@ -121,7 +133,7 @@ class CI_Parser { * @param string * @return void */ - function set_delimiters($l = '{', $r = '}') + public function set_delimiters($l = '{', $r = '}') { $this->l_delim = $l; $this->r_delim = $r; @@ -138,9 +150,9 @@ class CI_Parser { * @param string * @return string */ - function _parse_single($key, $val, $string) + private function _parse_single($key, $val, $string) { - return str_replace($this->l_delim.$key.$this->r_delim, $val, $string); + return str_replace($this->l_delim.$key.$this->r_delim, (string) $val, $string); } // -------------------------------------------------------------------- @@ -156,7 +168,7 @@ class CI_Parser { * @param string * @return string */ - function _parse_pair($variable, $data, $string) + private function _parse_pair($variable, $data, $string) { if (FALSE === ($match = $this->_match_pair($string, $variable))) { @@ -166,7 +178,7 @@ class CI_Parser { $str = ''; foreach ($data as $row) { - $temp = $match['1']; + $temp = $match[1]; foreach ($row as $key => $val) { if ( ! is_array($val)) @@ -182,7 +194,7 @@ class CI_Parser { $str .= $temp; } - return str_replace($match['0'], $str, $string); + return str_replace($match[0], $str, $string); } // -------------------------------------------------------------------- @@ -195,7 +207,7 @@ class CI_Parser { * @param string * @return mixed */ - function _match_pair($string, $variable) + private function _match_pair($string, $variable) { if ( ! preg_match("|" . preg_quote($this->l_delim) . $variable . preg_quote($this->r_delim) . "(.+?)". preg_quote($this->l_delim) . '/' . $variable . preg_quote($this->r_delim) . "|s", $string, $match)) { diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index ac58129a9..8a2568d8e 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -27,7 +39,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Libraries - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/general/profiling.html */ class CI_Profiler { diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 8ee08c5b2..08d2ba4ba 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Sessions - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/sessions.html */ class CI_Session { @@ -688,13 +700,7 @@ class CI_Session { { if (is_array($data)) { - foreach ($data as $key => $val) - { - if (is_string($val)) - { - $data[$key] = str_replace('\\', '{{slash}}', $val); - } - } + array_walk_recursive($data, array(&$this, '_escape_slashes')); } else { @@ -703,9 +709,23 @@ class CI_Session { $data = str_replace('\\', '{{slash}}', $data); } } - return serialize($data); } + + /** + * Escape slashes + * + * This function converts any slashes found into a temporary marker + * + * @access private + */ + function _escape_slashes(&$val, $key) + { + if (is_string($val)) + { + $val = str_replace('\\', '{{slash}}', $val); + } + } // -------------------------------------------------------------------- @@ -725,19 +745,27 @@ class CI_Session { if (is_array($data)) { - foreach ($data as $key => $val) - { - if (is_string($val)) - { - $data[$key] = str_replace('{{slash}}', '\\', $val); - } - } - + array_walk_recursive($data, array(&$this, '_unescape_slashes')); return $data; } return (is_string($data)) ? str_replace('{{slash}}', '\\', $data) : $data; } + + /** + * Unescape slashes + * + * This function converts any slash markers back into actual slashes + * + * @access private + */ + function _unescape_slashes(&$val, $key) + { + if (is_string($val)) + { + $val= str_replace('{{slash}}', '\\', $val); + } + } // -------------------------------------------------------------------- diff --git a/system/libraries/Sha1.php b/system/libraries/Sha1.php index 8e991f54a..477b92bcb 100644 --- a/system/libraries/Sha1.php +++ b/system/libraries/Sha1.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -39,7 +51,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Encryption - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/encryption.html */ class CI_SHA1 { diff --git a/system/libraries/Table.php b/system/libraries/Table.php index c14da727e..8d0e11a43 100644 --- a/system/libraries/Table.php +++ b/system/libraries/Table.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.3.1 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage Libraries * @category HTML Tables - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/table.html */ class CI_Table { diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php index b0a767822..1e5928314 100644 --- a/system/libraries/Trackback.php +++ b/system/libraries/Trackback.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,17 +35,17 @@ * @package CodeIgniter * @subpackage Libraries * @category Trackbacks - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/trackback.html */ class CI_Trackback { - var $time_format = 'local'; - var $charset = 'UTF-8'; - var $data = array('url' => '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => ''); - var $convert_ascii = TRUE; - var $response = ''; - var $error_msg = array(); + public $time_format = 'local'; + public $charset = 'UTF-8'; + public $data = array('url' => '', 'title' => '', 'excerpt' => '', 'blog_name' => '', 'charset' => ''); + public $convert_ascii = TRUE; + public $response = ''; + public $error_msg = array(); /** * Constructor @@ -54,7 +66,7 @@ class CI_Trackback { * @param array * @return bool */ - function send($tb_data) + public function send($tb_data) { if ( ! is_array($tb_data)) { @@ -135,7 +147,7 @@ class CI_Trackback { * @access public * @return bool */ - function receive() + public function receive() { foreach (array('url', 'title', 'blog_name', 'excerpt') as $val) { @@ -178,7 +190,7 @@ class CI_Trackback { * @param string * @return void */ - function send_error($message = 'Incomplete Information') + public function send_error($message = 'Incomplete Information') { echo "<?xml version=\"1.0\" encoding=\"utf-8\"?".">\n<response>\n<error>1</error>\n<message>".$message."</message>\n</response>"; exit; @@ -195,7 +207,7 @@ class CI_Trackback { * @access public * @return void */ - function send_success() + public function send_success() { echo "<?xml version=\"1.0\" encoding=\"utf-8\"?".">\n<response>\n<error>0</error>\n</response>"; exit; @@ -210,7 +222,7 @@ class CI_Trackback { * @param string * @return string */ - function data($item) + public function data($item) { return ( ! isset($this->data[$item])) ? '' : $this->data[$item]; } @@ -228,7 +240,7 @@ class CI_Trackback { * @param string * @return bool */ - function process($url, $data) + public function process($url, $data) { $target = parse_url($url); @@ -297,7 +309,7 @@ class CI_Trackback { * @param string * @return string */ - function extract_urls($urls) + public function extract_urls($urls) { // Remove the pesky white space and replace with a comma. $urls = preg_replace("/\s*(\S+)\s*/", "\\1,", $urls); @@ -333,7 +345,7 @@ class CI_Trackback { * @param string * @return string */ - function validate_url($url) + public function validate_url($url) { $url = trim($url); @@ -352,7 +364,7 @@ class CI_Trackback { * @param string * @return string */ - function get_id($url) + public function get_id($url) { $tb_id = ""; @@ -401,7 +413,7 @@ class CI_Trackback { * @param string * @return string */ - function convert_xml($str) + public function convert_xml($str) { $temp = '__TEMP_AMPERSANDS__'; @@ -431,7 +443,7 @@ class CI_Trackback { * @param string * @return string */ - function limit_characters($str, $n = 500, $end_char = '…') + public function limit_characters($str, $n = 500, $end_char = '…') { if (strlen($str) < $n) { @@ -468,7 +480,7 @@ class CI_Trackback { * @param string * @return string */ - function convert_ascii($str) + public function convert_ascii($str) { $count = 1; $out = ''; @@ -514,7 +526,7 @@ class CI_Trackback { * @param string * @return void */ - function set_error($msg) + public function set_error($msg) { log_message('error', $msg); $this->error_msg[] = $msg; @@ -530,19 +542,13 @@ class CI_Trackback { * @param string * @return string */ - function display_errors($open = '<p>', $close = '</p>') + public function display_errors($open = '<p>', $close = '</p>') { - $str = ''; - foreach ($this->error_msg as $val) - { - $str .= $open.$val.$close; - } - - return $str; + return (count($this->error_msg) > 0) ? $open . implode($close . $open, $this->error_msg) . $close : ''; } } // END Trackback Class /* End of file Trackback.php */ -/* Location: ./system/libraries/Trackback.php */
\ No newline at end of file +/* Location: ./system/libraries/Trackback.php */ diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php index f061311b0..af6ca2bf2 100644 --- a/system/libraries/Typography.php +++ b/system/libraries/Typography.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * * @access private * @category Helpers - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/typography.html */ class CI_Typography { diff --git a/system/libraries/Unit_test.php b/system/libraries/Unit_test.php index d9bc8ef6b..7afe40b09 100644 --- a/system/libraries/Unit_test.php +++ b/system/libraries/Unit_test.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.3.1 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage Libraries * @category UnitTesting - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/unit_testing.html */ class CI_Unit_test { diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index 045283f96..826bcceb8 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -21,7 +33,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Uploads - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/file_uploading.html */ class CI_Upload { @@ -922,13 +934,7 @@ class CI_Upload { */ public function display_errors($open = '<p>', $close = '</p>') { - $str = ''; - foreach ($this->error_msg as $val) - { - $str .= $open.$val.$close; - } - - return $str; + return (count($this->error_msg) > 0) ? $open . implode($close . $open, $this->error_msg) . $close : ''; } // -------------------------------------------------------------------- @@ -1021,7 +1027,7 @@ class CI_Upload { protected function _file_mime_type($file) { // Use if the Fileinfo extension, if available (only versions above 5.3 support the FILEINFO_MIME_TYPE flag) - if (is_php('5.3') && function_exists('finfo_file')) + if ( (float) substr(phpversion(), 0, 3) >= 5.3 && function_exists('finfo_file')) { $finfo = new finfo(FILEINFO_MIME_TYPE); if ($finfo !== FALSE) // This is possible, if there is no magic MIME database file found on the system diff --git a/system/libraries/User_agent.php b/system/libraries/User_agent.php index 2cdaf509d..a007acec8 100644 --- a/system/libraries/User_agent.php +++ b/system/libraries/User_agent.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -23,7 +35,7 @@ * @package CodeIgniter * @subpackage Libraries * @category User Agent - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/user_agent.html */ class CI_User_agent { diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index 5da6ea6ae..7b1e3fa6e 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -27,7 +39,7 @@ if ( ! function_exists('xml_parser_create')) * @package CodeIgniter * @subpackage Libraries * @category XML-RPC - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class CI_Xmlrpc { @@ -347,7 +359,7 @@ class CI_Xmlrpc { * XML-RPC Client class * * @category XML-RPC - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class XML_RPC_Client extends CI_Xmlrpc @@ -425,7 +437,7 @@ class XML_RPC_Client extends CI_Xmlrpc * XML-RPC Response class * * @category XML-RPC - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class XML_RPC_Response @@ -604,7 +616,7 @@ class XML_RPC_Response * XML-RPC Message class * * @category XML-RPC - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class XML_RPC_Message extends CI_Xmlrpc @@ -1203,7 +1215,7 @@ class XML_RPC_Message extends CI_Xmlrpc * XML-RPC Values class * * @category XML-RPC - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class XML_RPC_Values extends CI_Xmlrpc @@ -1404,14 +1416,14 @@ class XML_RPC_Values extends CI_Xmlrpc { if ($utc == 1) { - $t = strftime("%Y%m%dT%H:%M:%S", $time); + $t = strftime("%Y%m%dT%H:%i:%s", $time); } else { if (function_exists('gmstrftime')) - $t = gmstrftime("%Y%m%dT%H:%M:%S", $time); + $t = gmstrftime("%Y%m%dT%H:%i:%s", $time); else - $t = strftime("%Y%m%dT%H:%M:%S", $time - date('Z')); + $t = strftime("%Y%m%dT%H:%i:%s", $time - date('Z')); } return $t; } diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 9cd332147..587b75040 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -31,7 +43,7 @@ if ( ! class_exists('CI_Xmlrpc')) * @package CodeIgniter * @subpackage Libraries * @category XML-RPC - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/xmlrpc.html */ class CI_Xmlrpcs extends CI_Xmlrpc diff --git a/system/libraries/Zip.php b/system/libraries/Zip.php index 666327d5c..52f1bc3d0 100644 --- a/system/libraries/Zip.php +++ b/system/libraries/Zip.php @@ -4,10 +4,22 @@ * * An open source application development framework for PHP 5.1.6 or newer * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. + * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://codeigniter.com/user_guide/license.html + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) * @link http://codeigniter.com * @since Version 1.0 * @filesource @@ -27,7 +39,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Encryption - * @author ExpressionEngine Dev Team + * @author EllisLab Dev Team * @link http://codeigniter.com/user_guide/libraries/zip.html */ class CI_Zip { @@ -87,9 +99,9 @@ class CI_Zip { */ function _get_mod_time($dir) { - // filemtime() will return false, but it does raise an error. - $date = (@filemtime($dir)) ? filemtime($dir) : getdate($this->now); - + // filemtime() may return false, but raises an error for non-existing files + $date = (file_exists($dir)) ? filemtime($dir): getdate($this->now); + $time['file_mtime'] = ($date['hours'] << 11) + ($date['minutes'] << 5) + $date['seconds'] / 2; $time['file_mdate'] = (($date['year'] - 1980) << 9) + ($date['mon'] << 5) + $date['mday']; diff --git a/system/libraries/javascript/Jquery.php b/system/libraries/javascript/Jquery.php index baab83d25..4b8f76a10 100644 --- a/system/libraries/javascript/Jquery.php +++ b/system/libraries/javascript/Jquery.php @@ -1,27 +1,40 @@ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); - /** * CodeIgniter * - * An open source application development framework for PHP 4.3.2 or newer + * An open source application development framework for PHP 5.1.6 or newer + * + * NOTICE OF LICENSE + * + * Licensed under the Open Software License version 3.0 + * + * This source file is subject to the Open Software License (OSL 3.0) that is + * bundled with this package in the files license.txt / license.rst. It is + * also available through the world wide web at this URL: + * http://opensource.org/licenses/OSL-3.0 + * If you did not receive a copy of the license and are unable to obtain it + * through the world wide web, please send an email to + * licensing@ellislab.com so we can send you a copy immediately. * * @package CodeIgniter - * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. - * @license http://www.codeigniter.com/user_guide/license.html - * @link http://www.codeigniter.com + * @author EllisLab Dev Team + * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) + * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + * @link http://codeigniter.com * @since Version 1.0 * @filesource */ +// ------------------------------------------------------------------------ + /** * Jquery Class * * @package CodeIgniter * @subpackage Libraries - * @author ExpressionEngine Dev Team * @category Loader - * @link http://www.codeigniter.com/user_guide/libraries/javascript.html + * @author EllisLab Dev Team + * @link http://codeigniter.com/user_guide/libraries/javascript.html */ class CI_Jquery extends CI_Javascript { diff --git a/user_guide_src/cilexer/cilexer/cilexer.py b/user_guide_src/cilexer/cilexer/cilexer.py index 265b4077f..e571ce627 100644 --- a/user_guide_src/cilexer/cilexer/cilexer.py +++ b/user_guide_src/cilexer/cilexer/cilexer.py @@ -1,3 +1,25 @@ +# CodeIgniter +# http://codeigniter.com +# +# An open source application development framework for PHP 5.1.6 or newer +# +# NOTICE OF LICENSE +# +# Licensed under the Open Software License version 3.0 +# +# This source file is subject to the Open Software License (OSL 3.0) that is +# bundled with this package in the files license.txt / license.rst. It is +# also available through the world wide web at this URL: +# http://opensource.org/licenses/OSL-3.0 +# If you did not receive a copy of the license and are unable to obtain it +# through the world wide web, please send an email to +# licensing@ellislab.com so we can send you a copy immediately. +# +# Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) +# http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) + + + import re import copy diff --git a/user_guide_src/source/_themes/eldocs/layout.html b/user_guide_src/source/_themes/eldocs/layout.html index a79720ef1..4b1a0221c 100644 --- a/user_guide_src/source/_themes/eldocs/layout.html +++ b/user_guide_src/source/_themes/eldocs/layout.html @@ -84,7 +84,7 @@ <div id="brand" class="{{ project_abbreviation }}"> <a href="http://{{ project_domain }}/"><img src="{{ pathto('_static/asset/img/' + project_abbreviation + '-logo.gif', 1) }}" alt="{{ project }}"></a> - <p>{{ version }} User Guide</p> + <p>{{ release }} User Guide</p> {%- if show_source and has_source and sourcename %} <p><a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow">{{ _('Show Source') }}</a></p> diff --git a/user_guide_src/source/_themes/eldocs/static/asset/css/common.css b/user_guide_src/source/_themes/eldocs/static/asset/css/common.css index 28182a162..45b1fe724 100644 --- a/user_guide_src/source/_themes/eldocs/static/asset/css/common.css +++ b/user_guide_src/source/_themes/eldocs/static/asset/css/common.css @@ -1,3 +1,25 @@ +/* +CodeIgniter +http://codeigniter.com + +An open source application development framework for PHP 5.1.6 or newer + +NOTICE OF LICENSE + +Licensed under the Open Software License version 3.0 + +This source file is subject to the Open Software License (OSL 3.0) that is +bundled with this package in the files license.txt / license.rst. It is +also available through the world wide web at this URL: +http://opensource.org/licenses/OSL-3.0 +If you did not receive a copy of the license and are unable to obtain it +through the world wide web, please send an email to +licensing@ellislab.com so we can send you a copy immediately. + +Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) +http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) +*/ + html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dd, dt, pre, form, fieldset{ margin: 0; padding: 0; } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 7b89f1782..54237e3c7 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -2,25 +2,97 @@ Change Log ########## -Version 2.1.0 (planned) +Version 3.0 (planned) ======================= Release Date: Not Released +- License + + - CodeIgniter has been relicensed with the Open Software License (3.0), + eliminating its old proprietary licensing. + + - All system files are licensed with OSL 3.0. + - Config, error, and sample files shipped in the application folder are + licensed with the Academic Free License (3.0) to allow you to retain + all licensing authority over your own application code. + - General Changes + - Added an optional backtrace to php-error template. - Added Android to the list of user agents. - Added Windows 7 to the list of user platforms. + - Ability to log certain error types, not all under a threshold. + - Added support for pem, p10, p12, p7a, p7c, p7m, p7r, p7s, crt, crl, der, kdb, rsa, cer, sst, csr Certs to mimes.php. + - Added support pgp and gpg to mimes.php. + - Added support 3gp, 3g2, mp4, wmv, f4v, vlc Video files to mimes.php. + - Added support m4a, aac, m4u, xspf, au, ac3, flac, ogg Audio files to mimes.php. + - Changed logger to only chmod when file is first created. + +- Helpers + + - url_title() will now trim extra dashes from beginning and end. + - Added XHTML Basic 1.1 doctype to :doc:`HTML Helper <helpers/html_helper>`. + - Changed humanize to include a second param for the separator. + +- Database + + - Added new :doc:`Active Record <database/active_record>` methods that return + the SQL string of queries without executing them: get_compiled_select(), + get_compiled_insert(), get_compiled_update(), get_compiled_delete(). + - Taking care of LIKE condition when used with MySQL UPDATE statement. + - Adding $escape parameter to the order_by function, this enables ordering by custom fields. + +- Libraries + + - Added max_filename_increment config setting for Upload library. + - CI_Loader::_ci_autoloader() is now a protected method. + - Modified valid_ip() to use PHP's filter_var() when possible (>= PHP 5.2) in the :doc:`Form Validation library <libraries/form_validation>`. + - Added custom filename to Email::attach() as $this->email->attach($filename, $disposition, $newname) + - Cart library changes include: + - It now auto-increments quantity's instead of just resetting it, this is the default behaviour of large e-commerce sites. + - Product Name strictness can be disabled via the Cart Library by switching "$product_name_safe" + - Added function remove() to remove a cart item, updating with quantity of 0 seemed like a hack but has remained to retain compatability + - Minor speed optimizations and method & property visibility declarations in the Calendar Library. + +- Core + + - Changed private functions in CI_URI to protected so MY_URI can + override them. + - Removed CI_CORE boolean constant from CodeIgniter.php (no longer Reactor and Core versions). + +Bug fixes for 3.0 +------------------ + +- Unlink raised an error if cache file did not exist when you try to delete it. +- Fixed a bug (#181) where a mis-spelling was in the form validation + language file. +- Fixed a bug (#159, #163) that mishandled Active Record nested transactions because _trans_depth was not getting incremented. +- Fixed a bug (#737, #75) where pagination anchor class was not set properly when using initialize method. +- Fixed a bug (#419) - auto_link() now recognizes URLs that come after a word boundary. +- Fixed a bug (#724) - is_unique in form validation now checks that you are connected to a database. +- Fixed a bug (#647) - _get_mod_time() in Zip library no longer generates stat failed errors +- Fixed a bug (#608) - Fixes an issue with the Image_lib class not clearing properties completely +- Fixed bugs (#157 and #174) - the Image_lib clear() function now resets all variables to their default values. +- Fixed a bug where using $this->dbforge->create_table() with PostgreSQL database could lead to fetching whole table. +- Fixed a bug (#795) - Fixed form method and accept-charset when passing an empty array. +- Fixed a bug (#797) - timespan was using incorrect seconds for year and month. +- Fixed a bug in CI_Cart::contents() where if called without a TRUE (or equal) parameter, it would fail due to a typo. +- Fixed a bug (#696) - make oci_execute calls inside num_rows non-committing, since they are only there to reset which row is next in line for oci_fetch calls and thus don't need to be committed. +- Fixed a bug (#406) - sqlsrv DB driver not reuturning resource on <samp>db_pconnect()</samp>. + +Version 2.1.0 +============= + +Release Date: Not Released + +- General Changes + - Callback validation rules can now accept parameters like any other validation rule. - - Ability to log certain error types, not all under a threshold. - Added html_escape() to :doc:`Common functions <general/common_functions>` to escape HTML output for preventing XSS. - - Added support for pem,p10,p12,p7a,p7c,p7m,p7r,p7s,crt,crl,der,kdb,rsa,cer,sst,csr Certs to mimes.php. - - Added support pgp,gpg to mimes.php. - - Added support 3gp, 3g2, mp4, wmv, f4v, vlc Video files to mimes.php. - - Added support m4a, aac, m4u, xspf, au, ac3, flac, ogg Audio files to mimes.php. - Helpers @@ -31,7 +103,6 @@ Release Date: Not Released function call optional. Fixes (#65) - url_title() will now trim extra dashes from beginning and end. - Improved speed of :doc:`String Helper <helpers/string_helper>`'s random_string() method - - Added XHTML Basic 1.1 doctype to :doc:`HTML Helper <helpers/html_helper>`. - Database @@ -46,6 +117,7 @@ Release Date: Not Released $this->db->like() in the :doc:`Database Driver <database/active_record>`. - Added $this->db->insert_batch() support to the OCI8 (Oracle) driver. + - Added failover if the main connections in the config should fail - Libraries @@ -55,12 +127,12 @@ Release Date: Not Released - Added support to set an optional parameter in your callback rules of validation using the :doc:`Form Validation Library <libraries/form_validation>`. + - Added a :doc:`Migration library <libraries/migration>` to assist with applying + incremental updates to your database schema. - Driver children can be located in any package path. - Added max_filename_increment config setting for Upload library. - - CI_Loader::_ci_autoloader() is now a protected method. - Added is_unique to the :doc:`Form Validation library <libraries/form_validation>`. - - Modified valid_ip() to use PHP's filter_var() when possible (>= PHP 5.2) in the <a href="libraries/form_validation.html">Form Validation</a> library. - Added $config['use_page_numbers'] to the :doc:`Pagination library <libraries/pagination>`, which enables real page numbers in the URI. - Added TLS and SSL Encryption for SMTP. @@ -70,10 +142,11 @@ Release Date: Not Released override them. - Removed CI_CORE boolean constant from CodeIgniter.php (no longer Reactor and Core versions). + Bug fixes for 2.1.0 ------------------- -- Unlink raised an error if cache file did not exist when you try to delete it. + - Fixed #378 Robots identified as regular browsers by the User Agent class. - If a config class was loaded first then a library with the same name @@ -84,30 +157,27 @@ Bug fixes for 2.1.0 but the requested method did not. - Fixed a bug (Reactor #89) where MySQL export would fail if the table had hyphens or other non alphanumeric/underscore characters. -- Fixed a bug (#200) where MySQL queries would be malformed after - calling count_all() then db->get() -- Fixed bug #105 that stopped query errors from being logged unless database debugging was enabled -- Fixed a bug (#181) where a mis-spelling was in the form validation - language file. +- Fixed a bug (#200) where MySQL queries would be malformed after calling $this->db->count_all() then $this->db->get() +- Fixed a bug (#105) that stopped query errors from being logged unless database debugging was enabled - Fixed a bug (#160) - Removed unneeded array copy in the file cache driver. - Fixed a bug (#150) - field_data() now correctly returns column length. - Fixed a bug (#8) - load_class() now looks for core classes in APPPATH first, allowing them to be replaced. -- Fixed a bug (#24) - ODBC database driver called incorrect parent in - __construct(). -- Fixed a bug (#85) - OCI8 (Oracle) database escape_str() function did - not escape correct. -- Fixed a bug (#344) - Using schema found in <a href="libraries/sessions.html">Saving Session Data to a Database</a>, system would throw error "user_data does not have a default value" when deleting then creating a session. +- Fixed a bug (#24) - ODBC database driver called incorrect parent in __construct(). +- Fixed a bug (#85) - OCI8 (Oracle) database escape_str() function did not escape correct. +- Fixed a bug (#344) - Using schema found in :doc:`Saving Session Data to a Database <libraries/sessions>`, system would throw error "user_data does not have a default value" when deleting then creating a session. - Fixed a bug (#112) - OCI8 (Oracle) driver didn't pass the configured database character set when connecting. - Fixed a bug (#182) - OCI8 (Oracle) driver used to re-execute the statement whenever num_rows() is called. -- Fixed a bug (#82) - WHERE clause field names in the DB <samp>update_string()</samp> method were not escaped, resulting in failed queries in some cases. -- Fixed a bug (#89) - Fix a variable type mismatch in DB <samp>display_error()</samp> where an array is expected, but a string could be set instead. +- Fixed a bug (#82) - WHERE clause field names in the DB update_string() method were not escaped, resulting in failed queries in some cases. +- Fixed a bug (#89) - Fix a variable type mismatch in DB display_error() where an array is expected, but a string could be set instead. - Fixed a bug (#467) - Suppress warnings generated from get_magic_quotes_gpc() (deprecated in PHP 5.4) - Fixed a bug (#484) - First time _csrf_set_hash() is called, hash is never set to the cookie (in Security.php). -- Fixed a bug (#60) - Added _file_mime_type() method to the `File Uploading Library <libraries/file_uploading>` in order to fix a possible MIME-type injection. +- Fixed a bug (#60) - Added _file_mime_type() method to the :doc:`File Uploading Library <libraries/file_uploading>` in order to fix a possible MIME-type injection. - Fixed a bug (#537) - Support for all wav type in browser. +- Fixed a bug (#576) - Using ini_get() function to detect if apc is enabled or not. +- Fixed invalid date time format in :doc:`Date helper <helpers/date_helper>` and :doc:`XMLRPC library <libraries/xmlrpc>`. - Fixed a bug (#200) - MySQL queries would be malformed after calling count_all() then db->get(). Version 2.0.3 @@ -148,14 +218,6 @@ Release Date: August 20, 2011 - Added CSRF protection URI whitelisting. - Fixed a bug where :doc:`Email library <libraries/email>` attachments with a "." in the name would using invalid MIME-types. - - Added support for - pem,p10,p12,p7a,p7c,p7m,p7r,p7s,crt,crl,der,kdb,rsa,cer,sst,csr - Certs to mimes.php. - - Added support pgp,gpg to mimes.php. - - Added support 3gp, 3g2, mp4, wmv, f4v, vlc Video files to - mimes.php. - - Added support m4a, aac, m4u, xspf, au, ac3, flac, ogg Audio files - to mimes.php. - Helpers @@ -282,7 +344,7 @@ Hg Tag: v2.0.1 TRUE and Reactor: FALSE. - Added an ENVIRONMENT constant in index.php, which affects PHP error reporting settings, and optionally, which configuration - files are loaded (see below). Read more on the `Handling + files are loaded (see below). Read more on the :doc:`Handling Environments <general/environments>` page. - Added support for :ref:`environment-specific <config-environments>` @@ -290,7 +352,7 @@ Hg Tag: v2.0.1 - Libraries - - Added decimal, less_than and greater_than rules to the `Form + - Added decimal, less_than and greater_than rules to the :doc:`Form validation Class <libraries/form_validation>`. - :doc:`Input Class <libraries/input>` methods post() and get() will now return a full array if the first argument is not @@ -320,6 +382,8 @@ Bug fixes for 2.0.1 - Fixed a bug (Reactor #69) where the SHA1 library was named incorrectly. +.. _2.0.0-changelog: + Version 2.0.0 ============= @@ -362,7 +426,7 @@ Hg Tag: v2.0.0 - Removed the deprecated Validation Class. - Added CI\_ Prefix to all core classes. - Package paths can now be set in application/config/autoload.php. - - `Upload library <libraries/file_uploading>` file_name can + - :doc:`Upload library <libraries/file_uploading>` file_name can now be set without an extension, the extension will be taken from the uploaded file instead of the given name. - In :doc:`Database Forge <database/forge>` the name can be omitted @@ -534,7 +598,7 @@ Hg Tag: v2.0.0 - Added "default" to the list :doc:`Reserved Names <general/reserved_names>`. - Added 'application/x-msdownload' for .exe files and - ''application/x-gzip-compressed' for .tgz files to + 'application/x-gzip-compressed' for .tgz files to config/mimes.php. - Updated the output library to no longer compress output or send content-length headers if the server runs with @@ -665,7 +729,7 @@ Hg Tag: v1.7.2 - General - - Compatible with PHP 5.3.0 + - Compatible with PHP 5.3.0. - Modified :doc:`show_error() <general/errors>` to allow sending of HTTP server response codes. - Modified :doc:`show_404() <general/errors>` to send 404 status @@ -1273,7 +1337,7 @@ Hg Tag: 1.6.1 URL encoded strings. - Added $_SERVER, $_FILES, $_ENV, and $_SESSION to sanitization of globals. - - Added a `Path Helper <./helpers/path_helper>`. + - Added a :doc:`Path Helper <./helpers/path_helper>`. - Simplified _reindex_segments() in the URI class. - Escaped the '-' in the default 'permitted_uri_chars' config item, to prevent errors if developers just try to add additional @@ -1680,7 +1744,7 @@ Version 1.5.2 Release Date: February 13, 2007 - Added subversion information - to the `downloads <installation/downloads>` page. + to the :doc:`downloads <installation/downloads>` page. - Added support for captions in the :doc:`Table Library <./libraries/table>` - Fixed a bug in the @@ -1736,7 +1800,7 @@ Version 1.5.0 Release Date: October 30, 2006 -- Added `DB utility class <./database/utilities>`, permitting DB +- Added :doc:`DB utility class <./database/utilities>`, permitting DB backups, CVS or XML files from DB results, and various other functions. - Added :doc:`Database Caching Class <./database/caching>`. @@ -1895,7 +1959,7 @@ Release Date: September 17, 2006 sub-folders <general/controllers>`. Kudos to Marco for `suggesting <http://codeigniter.com/forums/viewthread/627/>`_ this (and the next two) feature. -- Added regular expressions support for `routing +- Added regular expressions support for :doc:`routing rules <./general/routing>`. - Added the ability to :doc:`remap function calls <./general/controllers>` within your controllers. diff --git a/user_guide_src/source/conf.py b/user_guide_src/source/conf.py index bd5e65297..bb10d06e4 100644 --- a/user_guide_src/source/conf.py +++ b/user_guide_src/source/conf.py @@ -48,9 +48,9 @@ copyright = u'2011, EllisLab, Inc.' # built documents. # # The short X.Y version. -version = '2.1' +version = '3.0' # The full version, including alpha/beta/rc tags. -release = '2.1.0' +release = '3.0-dev' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/user_guide_src/source/database/active_record.rst b/user_guide_src/source/database/active_record.rst index e1fc00bc5..228d1d509 100644 --- a/user_guide_src/source/database/active_record.rst +++ b/user_guide_src/source/database/active_record.rst @@ -54,6 +54,37 @@ $query, which can be used to show the results:: Please visit the :doc:`result functions <results>` page for a full discussion regarding result generation. +$this->db->get_compiled_select() +================================ + +Compiles the selection query just like `$this->db->get()`_ but does not *run* +the query. This method simply returns the SQL query as a string. + +Example:: + + $sql = $this->db->get_compiled_select('mytable'); + echo $sql; + + // Produces string: SELECT * FROM mytable + +The second parameter enables you to set whether or not the active record query +will be reset (by default it will be—just like `$this->db->get()`):: + + echo $this->db->limit(10,20)->get_compiled_select('mytable', FALSE); + // Produces string: SELECT * FROM mytable LIMIT 20, 10 + // (in MySQL. Other databases have slightly different syntax) + + echo $this->db->select('title, content, date')->get_compiled_select(); + + // Produces string: SELECT title, content, date FROM mytable + +The key thing to notice in the above example is that the second query did not +utilize `$this->db->from()`_ and did not pass a table name into the first +parameter. The reason for this outcome is because the query has not been +executed using `$this->db->get()`_ which resets values or reset directly +using `$this-db->reset_query()`_. + + $this->db->get_where() ====================== @@ -65,7 +96,7 @@ function:: Please read the about the where function below for more information. -Note: get_where() was formerly known as getwhere(), which has been +.. note:: get_where() was formerly known as getwhere(), which has been removed $this->db->select() @@ -167,7 +198,7 @@ Permits you to write the JOIN portion of your query:: $query = $this->db->get(); // Produces: - // SELECT * FROM blogs // JOIN comments ON comments.id = blogs.id + // SELECT * FROM blogs JOIN comments ON comments.id = blogs.id Multiple function calls can be made if you need several joins in one query. @@ -540,6 +571,41 @@ object. .. note:: All values are escaped automatically producing safer queries. +$this->db->get_compiled_insert() +================================ +Compiles the insertion query just like `$this->db->insert()`_ but does not +*run* the query. This method simply returns the SQL query as a string. + +Example:: + + $data = array( + 'title' => 'My title', + 'name' => 'My Name', + 'date' => 'My date' + ); + + $sql = $this->db->set($data)->get_compiled_insert('mytable'); + echo $sql; + + // Produces string: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date') + +The second parameter enables you to set whether or not the active record query +will be reset (by default it will be--just like `$this->db->insert()`_):: + + echo $this->db->set('title', 'My Title')->get_compiled_insert('mytable', FALSE); + + // Produces string: INSERT INTO mytable (title) VALUES ('My Title') + + echo $this->db->set('content', 'My Content')->get_compiled_insert(); + + // Produces string: INSERT INTO mytable (title, content) VALUES ('My Title', 'My Content') + +The key thing to notice in the above example is that the second query did not +utlize `$this->db->from()`_ nor did it pass a table name into the first +parameter. The reason this worked is because the query has not been executed +using `$this->db->insert()`_ which resets values or reset directly using +`$this->db->reset_query()`_. + $this->db->insert_batch() ========================= @@ -717,6 +783,14 @@ array of values, the third parameter is the where key. .. note:: All values are escaped automatically producing safer queries. +$this->db->get_compiled_update() +================================ + +This works exactly the same way as ``$this->db->get_compiled_insert()`` except +that it produces an UPDATE SQL string instead of an INSERT SQL string. + +For more information view documentation for `$this->get_compiled_insert()`_. + ************* Deleting Data @@ -762,7 +836,7 @@ $this->db->empty_table() Generates a delete SQL string and runs the query.:: - $this->db->empty_table('mytable'); // Produces // DELETE FROM mytable + $this->db->empty_table('mytable'); // Produces: DELETE FROM mytable $this->db->truncate() @@ -773,7 +847,7 @@ Generates a truncate SQL string and runs the query. :: $this->db->from('mytable'); - $this->db->truncate(); + $this->db->truncate(); // or @@ -784,6 +858,13 @@ Generates a truncate SQL string and runs the query. .. note:: If the TRUNCATE command isn't available, truncate() will execute as "DELETE FROM table". + +$this->db->get_compiled_delete() +================================ +This works exactly the same way as ``$this->db->get_compiled_insert()`` except +that it produces a DELETE SQL string instead of an INSERT SQL string. + +For more information view documentation for `$this->get_compiled_insert()`_. *************** Method Chaining @@ -797,8 +878,6 @@ multiple functions. Consider this example:: ->limit(10, 20) ->get('mytable'); -.. note:: Method chaining only works with PHP 5. - .. _ar-caching: ********************* @@ -854,3 +933,31 @@ Here's a usage example:: where, like, group_by, having, order_by, set + +******************* +Reset Active Record +******************* + +Resetting Active Record allows you to start fresh with your query without +executing it first using a method like $this->db->get() or $this->db->insert(). +Just like the methods that execute a query, this will *not* reset items you've +cached using `Active Record Caching`_. + +This is useful in situations where you are using Active Record to generate SQL +(ex. ``$this->db->get_compiled_select()``) but then choose to, for instance, +run the query:: + + // Note that the second parameter of the get_compiled_select method is FALSE + $sql = $this->db->select(array('field1','field2')) + ->where('field3',5) + ->get_compiled_select('mytable', FALSE); + + // ... + // Do something crazy with the SQL code... like add it to a cron script for + // later execution or something... + // ... + + $data = $this->db->get()->result_array(); + + // Would execute and return an array of results of the following query: + // SELECT field1, field1 from mytable where field3 = 5; diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst index 687f0d920..433c67152 100644 --- a/user_guide_src/source/database/configuration.rst +++ b/user_guide_src/source/database/configuration.rst @@ -28,6 +28,48 @@ prototype:: $db['default']['autoinit'] = TRUE; $db['default']['stricton'] = FALSE; +You can also specify failovers for the situation when the main connection cannot connect for some reason. +These failovers can be specified by setting the failover for a connection like this:: + + $db['default']['failover'] = array( + array( + 'hostname' => 'localhost1', + 'username' => '', + 'password' => '', + 'database' => '', + 'dbdriver' => 'mysql', + 'dbprefix' => '', + 'pconnect' => TRUE, + 'db_debug' => TRUE, + 'cache_on' => FALSE, + 'cachedir' => '', + 'char_set' => 'utf8', + 'dbcollat' => 'utf8_general_ci', + 'swap_pre' => '', + 'autoinit' => TRUE, + 'stricton' => FALSE + ), + array( + 'hostname' => 'localhost2', + 'username' => '', + 'password' => '', + 'database' => '', + 'dbdriver' => 'mysql', + 'dbprefix' => '', + 'pconnect' => TRUE, + 'db_debug' => TRUE, + 'cache_on' => FALSE, + 'cachedir' => '', + 'char_set' => 'utf8', + 'dbcollat' => 'utf8_general_ci', + 'swap_pre' => '', + 'autoinit' => TRUE, + 'stricton' => FALSE + ) + ); + +You can specify as many failovers as you like. + The reason we use a multi-dimensional array rather than a more simple one is to permit you to optionally store multiple sets of connection values. If, for example, you run multiple environments (development, diff --git a/user_guide_src/source/database/connecting.rst b/user_guide_src/source/database/connecting.rst index 64adc3047..a834cc0f7 100644 --- a/user_guide_src/source/database/connecting.rst +++ b/user_guide_src/source/database/connecting.rst @@ -57,7 +57,19 @@ file. To connect manually to a desired database you can pass an array of values:: - $config['hostname'] = "localhost"; $config['username'] = "myusername"; $config['password'] = "mypassword"; $config['database'] = "mydatabase"; $config['dbdriver'] = "mysql"; $config['dbprefix'] = ""; $config['pconnect'] = FALSE; $config['db_debug'] = TRUE; $config['cache_on'] = FALSE; $config['cachedir'] = ""; $config['char_set'] = "utf8"; $config['dbcollat'] = "utf8_general_ci"; $this->load->database($config); + $config['hostname'] = "localhost"; + $config['username'] = "myusername"; + $config['password'] = "mypassword"; + $config['database'] = "mydatabase"; + $config['dbdriver'] = "mysql"; + $config['dbprefix'] = ""; + $config['pconnect'] = FALSE; + $config['db_debug'] = TRUE; + $config['cache_on'] = FALSE; + $config['cachedir'] = ""; + $config['char_set'] = "utf8"; + $config['dbcollat'] = "utf8_general_ci"; + $this->load->database($config); For information on each of these values please see the :doc:`configuration page <configuration>`. @@ -68,14 +80,16 @@ page <configuration>`. Or you can submit your database values as a Data Source Name. DSNs must have this prototype:: - $dsn = 'dbdriver://username:password@hostname/database'; $this->load->database($dsn); + $dsn = 'dbdriver://username:password@hostname/database'; + $this->load->database($dsn); To override default config values when connecting with a DSN string, add the config variables as a query string. :: - $dsn = 'dbdriver://username:password@hostname/database?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=/path/to/cache'; $this->load->database($dsn); + $dsn = 'dbdriver://username:password@hostname/database?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=/path/to/cache'; + $this->load->database($dsn); Connecting to Multiple Databases ================================ @@ -83,7 +97,8 @@ Connecting to Multiple Databases If you need to connect to more than one database simultaneously you can do so as follows:: - $DB1 = $this->load->database('group_one', TRUE); $DB2 = $this->load->database('group_two', TRUE); + $DB1 = $this->load->database('group_one', TRUE); + $DB2 = $this->load->database('group_two', TRUE); Note: Change the words "group_one" and "group_two" to the specific group names you are connecting to (or you can pass the connection values diff --git a/user_guide_src/source/general/urls.rst b/user_guide_src/source/general/urls.rst index 211537675..3126fcf36 100644 --- a/user_guide_src/source/general/urls.rst +++ b/user_guide_src/source/general/urls.rst @@ -45,12 +45,13 @@ method in which everything is redirected except the specified items: :: - RewriteEngine on - RewriteCond $1 !^(index\.php|images|robots\.txt) + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] -In the above example, any HTTP request other than those for index.php, -images, and robots.txt is treated as a request for your index.php file. +In the above example, any HTTP request other than those for existing +directories and existing files is treated as a request for your index.php file. Adding a URL Suffix =================== diff --git a/user_guide_src/source/helpers/directory_helper.rst b/user_guide_src/source/helpers/directory_helper.rst index 6c259adb1..fd169886c 100644 --- a/user_guide_src/source/helpers/directory_helper.rst +++ b/user_guide_src/source/helpers/directory_helper.rst @@ -18,15 +18,20 @@ This helper is loaded using the following code The following functions are available: -directory_map('source directory') -================================= +directory_map() +=============== This function reads the directory path specified in the first parameter and builds an array representation of it and all its contained files. + +.. php:method:: directory_map($source_dir[, $directory_depth = 0[, $hidden = FALSE]]) -Example - -:: + :param string $source_dir: path to the ource directory + :param integer $directory_depth: depth of directories to traverse (0 = + fully recursive, 1 = current dir, etc) + :param boolean $hidden: whether to include hidden directories + +Examples:: $map = directory_map('./mydirectory/'); @@ -35,23 +40,17 @@ Example Sub-folders contained within the directory will be mapped as well. If you wish to control the recursion depth, you can do so using the second -parameter (integer). A depth of 1 will only map the top level directory - -:: +parameter (integer). A depth of 1 will only map the top level directory:: $map = directory_map('./mydirectory/', 1); By default, hidden files will not be included in the returned array. To -override this behavior, you may set a third parameter to true (boolean) - -:: +override this behavior, you may set a third parameter to true (boolean):: $map = directory_map('./mydirectory/', FALSE, TRUE); Each folder name will be an array index, while its contained files will -be numerically indexed. Here is an example of a typical array - -:: +be numerically indexed. Here is an example of a typical array:: Array ( [libraries] => Array diff --git a/user_guide_src/source/helpers/inflector_helper.rst b/user_guide_src/source/helpers/inflector_helper.rst index cf246b9de..cc46a1851 100644 --- a/user_guide_src/source/helpers/inflector_helper.rst +++ b/user_guide_src/source/helpers/inflector_helper.rst @@ -77,3 +77,9 @@ them. Each word is capitalized. Example $word = "my_dog_spot"; echo humanize($word); // Returns "My Dog Spot" +To use dashes instead of underscores + +:: + + $word = "my-dog-spot"; + echo humanize($word, '-'); // Returns "My Dog Spot"
\ No newline at end of file diff --git a/user_guide_src/source/helpers/number_helper.rst b/user_guide_src/source/helpers/number_helper.rst index 28bc2f200..af6cdad57 100644 --- a/user_guide_src/source/helpers/number_helper.rst +++ b/user_guide_src/source/helpers/number_helper.rst @@ -42,4 +42,4 @@ result. echo byte_format(45678, 2); // Returns 44.61 KB .. note:: The text generated by this function is found in the following - language file: language//number_lang.php + language file: language/<your_lang>/number_lang.php diff --git a/user_guide_src/source/helpers/string_helper.rst b/user_guide_src/source/helpers/string_helper.rst index b8a69e036..dc70e461a 100644 --- a/user_guide_src/source/helpers/string_helper.rst +++ b/user_guide_src/source/helpers/string_helper.rst @@ -58,7 +58,7 @@ Usage example echo increment_string('file', '_'); // "file_1" echo increment_string('file', '-', 2); // "file-2" - echo increment_string('file-4'); // "file-5" + echo increment_string('file_4'); // "file_5" alternator() ============ diff --git a/user_guide_src/source/helpers/text_helper.rst b/user_guide_src/source/helpers/text_helper.rst index e97643275..8cb2d6f96 100644 --- a/user_guide_src/source/helpers/text_helper.rst +++ b/user_guide_src/source/helpers/text_helper.rst @@ -46,6 +46,9 @@ more or less then what you specify. Example The third parameter is an optional suffix added to the string, if undeclared this helper uses an ellipsis. +**Note:** If you need to truncate to an exact number of characters please see +the :ref:`ellipsize` function below. + ascii_to_entities() =================== @@ -136,6 +139,8 @@ complete words. Example // Would produce: Here is a simple string of text that will help us demonstrate this function +.. _ellipsize: + ellipsize() =========== diff --git a/user_guide_src/source/helpers/url_helper.rst b/user_guide_src/source/helpers/url_helper.rst index c72558705..e6d51b22b 100644 --- a/user_guide_src/source/helpers/url_helper.rst +++ b/user_guide_src/source/helpers/url_helper.rst @@ -284,23 +284,24 @@ redirect() ========== Does a "header redirect" to the URI specified. If you specify the full -site URL that link will be build, but for local links simply providing +site URL that link will be built, but for local links simply providing the URI segments to the controller you want to direct to will create the link. The function will build the URL based on your config file values. -The optional second parameter allows you to choose between the -"location" method (default) or the "refresh" method. Location is faster, -but on Windows servers it can sometimes be a problem. The optional third -parameter allows you to send a specific HTTP Response Code - this could -be used for example to create 301 redirects for search engine purposes. -The default Response Code is 302. The third parameter is *only* -available with 'location' redirects, and not 'refresh'. Examples +The optional second parameter allows you to force a particular redirection +method. The available methods are "location" or "refresh", with location +being faster but less reliable on Windows servers. The default is "auto", +which will attempt to intelligently choose the method based on the server +environment. -:: +The optional third parameter allows you to send a specific HTTP Response +Code - this could be used for example to create 301 redirects for search +engine purposes. The default Response Code is 302. The third parameter is +*only* available with 'location' redirects, and not 'refresh'. Examples:: if ($logged_in == FALSE) { - redirect('/login/form/', 'refresh'); + redirect('/login/form/'); } // with 301 redirect diff --git a/user_guide_src/source/installation/upgrade_200.rst b/user_guide_src/source/installation/upgrade_200.rst index 064e1b534..0bcbd5c99 100644 --- a/user_guide_src/source/installation/upgrade_200.rst +++ b/user_guide_src/source/installation/upgrade_200.rst @@ -5,6 +5,10 @@ Upgrading from 1.7.2 to 2.0.0 Before performing an update you should take your site offline by replacing the index.php file with a static one. +******************* +Update Instructions +******************* + Step 1: Update your CodeIgniter files ===================================== @@ -88,3 +92,51 @@ Step 8: Update your user guide Please replace your local copy of the user guide with the new version, including the image files. + + +************ +Update Notes +************ + +Please refer to the :ref:`2.0.0 Change Log <2.0.0-changelog>` for full +details, but here are some of the larger changes that are more likely to +impact your code: + +- CodeIgniter now requires PHP 5.1.6. +- Scaffolding has been removed. +- The CAPTCHA plugin in now a :doc:`helper </helpers/captcha_helper>`. +- The JavaScript calendar plugin was removed. +- The *system/cache* and *system/logs* directories are now in the application + directory. +- The Validation class has been removed. Please see the + :doc:`Form Validation library </libraries/form_validation>` +- "default" is now a reserved name. +- The xss_clean() function has moved to the :doc:`Security Class + </libraries/security>`. +- do_xss_clean() now returns FALSE if the uploaded file fails XSS checks. +- The :doc:`Session Class </libraries/sessions>` requires now the use of an + encryption key set in the config file. +- The following deprecated Active Record functions have been removed: + ``orwhere``, ``orlike``, ``groupby``, ``orhaving``, ``orderby``, + ``getwhere``. +- ``_drop_database()`` and ``_create_database()`` functions have been removed + from the db utility drivers. +- The ``dohash()`` function of the :doc:`Security helper + </helpers/security_helper>` + has been renamed to ``do_hash()`` for naming consistency. + +The config folder +================= + +The following files have been changed: + +- config.php +- database.php +- mimes.php +- routes.php +- user_agents.php + +The following files have been added: + +- foreign_chars.php +- profiler.php diff --git a/user_guide_src/source/libraries/cart.rst b/user_guide_src/source/libraries/cart.rst index 850d7e9a8..fbf777884 100644 --- a/user_guide_src/source/libraries/cart.rst +++ b/user_guide_src/source/libraries/cart.rst @@ -256,6 +256,11 @@ $this->cart->update(); Permits you to update items in the shopping cart, as outlined above. +$this->cart->remove(rowid); +********************** + +Allows you to remove an item from the shopping cart by passing it the rowid. + $this->cart->total(); ********************* @@ -266,10 +271,13 @@ $this->cart->total_items(); Displays the total number of items in the cart. -$this->cart->contents(); +$this->cart->contents(boolean); ************************ -Returns an array containing everything in the cart. +Returns an array containing everything in the cart. You can sort the order, +by which this is returned by passing it "true" where the contents will be sorted +from newest to oldest, by leaving this function blank, you'll automatically just get +first added to the basket to last added to the basket. $this->cart->has_options(rowid); ********************************* diff --git a/user_guide_src/source/libraries/email.rst b/user_guide_src/source/libraries/email.rst index 759899242..27b704dae 100644 --- a/user_guide_src/source/libraries/email.rst +++ b/user_guide_src/source/libraries/email.rst @@ -228,7 +228,11 @@ use the function multiple times. For example:: $this->email->attach('/path/to/photo2.jpg'); $this->email->attach('/path/to/photo3.jpg'); - $this->email->send(); +If you'd like to change the disposition or add a custom file name, you can use the second and third paramaters. To use the default disposition (attachment), leave the second parameter blank. Here's an example:: + + $this->email->attach('/path/to/photo1.jpg', 'inline'); + $this->email->attach('/path/to/photo1.jpg', '', 'birthday.jpg'); + $this->email->print_debugger() ------------------------------- diff --git a/user_guide_src/source/libraries/image_lib.rst b/user_guide_src/source/libraries/image_lib.rst index 300cbef31..14bd128a6 100644 --- a/user_guide_src/source/libraries/image_lib.rst +++ b/user_guide_src/source/libraries/image_lib.rst @@ -360,7 +360,7 @@ Preference Default Value Options Description image headers. **quality** 90% 1 - 100% Sets the quality of the image. The higher the quality the larger the file size. -**padding** None A number The amount of padding, set in pixels, that will be applied to the +**wm_padding** None A number The amount of padding, set in pixels, that will be applied to the watermark to set it away from the edge of your images. **wm_vrt_alignment** bottom top, middle, bottom Sets the vertical alignment for the watermark image. **wm_hor_alignment** center left, center, right Sets the horizontal alignment for the watermark image. diff --git a/user_guide_src/source/libraries/migration.rst b/user_guide_src/source/libraries/migration.rst new file mode 100644 index 000000000..5192f1f29 --- /dev/null +++ b/user_guide_src/source/libraries/migration.rst @@ -0,0 +1,5 @@ +################ +Migrations Class +################ + +Coming soon.
\ No newline at end of file diff --git a/user_guide_src/source/license.rst b/user_guide_src/source/license.rst index bf689a03a..17179a95c 100644 --- a/user_guide_src/source/license.rst +++ b/user_guide_src/source/license.rst @@ -1,62 +1,245 @@ -############################# -CodeIgniter License Agreement -############################# - -Copyright (c) 2008 - 2011, EllisLab, Inc. -All rights reserved. - -This license is a legal agreement between you and EllisLab Inc. for the -use of CodeIgniter Software (the "Software"). By obtaining the Software -you agree to comply with the terms and conditions of this license. - -Permitted Use -============= - -You are permitted to use, copy, modify, and distribute the Software and -its documentation, with or without modification, for any purpose, -provided that the following conditions are met: - -#. A copy of this license agreement must be included with the - distribution. -#. Redistributions of source code must retain the above copyright notice - in all source code files. -#. Redistributions in binary form must reproduce the above copyright - notice in the documentation and/or other materials provided with the - distribution. -#. Any files that have been modified must carry notices stating the - nature of the change and the names of those who changed them. -#. Products derived from the Software must include an acknowledgment - that they are derived from CodeIgniter in their documentation and/or - other materials provided with the distribution. -#. Products derived from the Software may not be called "CodeIgniter", - nor may "CodeIgniter" appear in their name, without prior written - permission from EllisLab, Inc. - -Indemnity -========= - -You agree to indemnify and hold harmless the authors of the Software and -any contributors for any direct, indirect, incidental, or consequential -third-party claims, actions or suits, as well as any related expenses, -liabilities, damages, settlements or fees arising from your use or -misuse of the Software, or a violation of any terms of this license. - -Disclaimer of Warranty -====================== - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF -QUALITY, PERFORMANCE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR -A PARTICULAR PURPOSE. - -Limitations of Liability -======================== - -YOU ASSUME ALL RISK ASSOCIATED WITH THE INSTALLATION AND USE OF THE -SOFTWARE. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE -SOFTWARE BE LIABLE FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, -OUT OF, OR IN CONNECTION WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY -RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USE AND ASSUME ALL -RISKS ASSOCIATED WITH ITS USE, INCLUDING BUT NOT LIMITED TO THE RISKS OF -PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF DATA OR SOFTWARE PROGRAMS, -OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS. +################################### +Open Software License ("OSL") v 3.0 +################################### + +This Open Software License (the "License") applies to any original work of +authorship (the "Original Work") whose owner (the "Licensor") has placed the +following licensing notice adjacent to the copyright notice for the Original +Work: + +*Licensed under the Open Software License version 3.0* + + +***************************** +1) Grant of Copyright License +***************************** + +Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable +license, for the duration of the copyright, to do the following: + + *a)* to reproduce the Original Work in copies, either alone or as part of + a collective work; + + *b)* to translate, adapt, alter, transform, modify, or arrange the + Original Work, thereby creating derivative works ("Derivative Works") + based upon the Original Work; + + *c)* to distribute or communicate copies of the Original Work and + Derivative Works to the public, *with the proviso that copies of Original + Work or Derivative Works that You distribute or communicate shall be + licensed under this Open Software License*; + + *d)* to perform the Original Work publicly; and + + *e)* to display the Original Work publicly. + + +************************** +2) Grant of Patent License +************************** + +Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable +license, under patent claims owned or controlled by the Licensor that are +embodied in the Original Work as furnished by the Licensor, for the duration +of the patents, to make, use, sell, offer for sale, have made, and import the +Original Work and Derivative Works. + + +******************************* +3) Grant of Source Code License +******************************* + +The term "Source Code" means the preferred form of the Original Work for +making modifications to it and all available documentation describing how to +modify the Original Work. Licensor agrees to provide a machine-readable copy +of the Source Code of the Original Work along with each copy of the Original +Work that Licensor distributes. Licensor reserves the right to satisfy this +obligation by placing a machine-readable copy of the Source Code in an +information repository reasonably calculated to permit inexpensive and +convenient access by You for as long as Licensor continues to distribute the +Original Work. + + +******************************** +4) Exclusions From License Grant +******************************** + +Neither the names of Licensor, nor the names of any contributors to the +Original Work, nor any of their trademarks or service marks, may be used to +endorse or promote products derived from this Original Work without express +prior permission of the Licensor. Except as expressly stated herein, nothing +in this License grants any license to Licensor's trademarks, copyrights, +patents, trade secrets or any other intellectual property. No patent license +is granted to make, use, sell, offer for sale, have made, or import +embodiments of any patent claims other than the licensed claims defined in +Section 2) No license is granted to the trademarks of Licensor even if such +marks are included in the Original Work. Nothing in this License shall be +interpreted to prohibit Licensor from licensing under terms different from +this License any Original Work that Licensor otherwise would have a right to +license. + + +********************** +5) External Deployment +********************** + +The term "External Deployment" means the use, distribution, or communication +of the Original Work or Derivative Works in any way such that the Original +Work or Derivative Works may be used by anyone other than You, whether those +works are distributed or communicated to those persons or made available as an +application intended for use over a network. As an express condition for the +grants of license hereunder, You must treat any External Deployment by You of +the Original Work or a Derivative Work as a distribution under section 1(c). + + +********************* +6) Attribution Rights +********************* + +You must retain, in the Source Code of any Derivative Works that You create, +all copyright, patent, or trademark notices from the Source Code of the +Original Work, as well as any notices of licensing and any descriptive text +identified therein as an "Attribution Notice." You must cause the Source Code +for any Derivative Works that You create to carry a prominent Attribution +Notice reasonably calculated to inform recipients that You have modified the +Original Work. + + +**************************************************** +7) Warranty of Provenance and Disclaimer of Warranty +**************************************************** + +Licensor warrants that the copyright in and to the Original Work and the +patent rights granted herein by Licensor are owned by the Licensor or are +sublicensed to You under the terms of this License with the permission of the +contributor(s) of those copyrights and patent rights. Except as expressly +stated in the immediately preceding sentence, the Original Work is provided +under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or +implied, including, without limitation, the warranties of non-infringement, +merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE +QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY +constitutes an essential part of this License. No license to the Original Work +is granted by this License except under this disclaimer. + + +************************** +8) Limitation of Liability +************************** + +Under no circumstances and under no legal theory, whether in tort (including +negligence), contract, or otherwise, shall the Licensor be liable to anyone +for any indirect, special, incidental, or consequential damages of any +character arising as a result of this License or the use of the Original Work +including, without limitation, damages for loss of goodwill, work stoppage, +computer failure or malfunction, or any and all other commercial damages or +losses. This limitation of liability shall not apply to the extent applicable +law prohibits such limitation. + + +***************************** +9) Acceptance and Termination +***************************** + +If, at any time, You expressly assented to this License, that assent indicates +your clear and irrevocable acceptance of this License and all of its terms and +conditions. If You distribute or communicate copies of the Original Work or a +Derivative Work, You must make a reasonable effort under the circumstances to +obtain the express assent of recipients to the terms of this License. This +License conditions your rights to undertake the activities listed in Section +1, including your right to create Derivative Works based upon the Original +Work, and doing so without honoring these terms and conditions is prohibited +by copyright law and international treaty. Nothing in this License is intended +to affect copyright exceptions and limitations (including "fair use" or "fair +dealing"). This License shall terminate immediately and You may no longer +exercise any of the rights granted to You by this License upon your failure to +honor the conditions in Section 1(c). + + +********************************* +10) Termination for Patent Action +********************************* + +This License shall terminate automatically and You may no longer exercise any +of the rights granted to You by this License as of the date You commence an +action, including a cross-claim or counterclaim, against Licensor or any +licensee alleging that the Original Work infringes a patent. This termination +provision shall not apply for an action alleging patent infringement by +combinations of the Original Work with other software or hardware. + + +***************************************** +11) Jurisdiction, Venue and Governing Law +***************************************** + +Any action or suit relating to this License may be brought only in the courts +of a jurisdiction wherein the Licensor resides or in which Licensor conducts +its primary business, and under the laws of that jurisdiction excluding its +conflict-of-law provisions. The application of the United Nations Convention +on Contracts for the International Sale of Goods is expressly excluded. Any +use of the Original Work outside the scope of this License or after its +termination shall be subject to the requirements and penalties of copyright or +patent law in the appropriate jurisdiction. This section shall survive the +termination of this License. + + +******************* +12) Attorneys' Fees +******************* + +In any action to enforce the terms of this License or seeking damages relating +thereto, the prevailing party shall be entitled to recover its costs and +expenses, including, without limitation, reasonable attorneys' fees and costs +incurred in connection with such action, including any appeal of such action. +This section shall survive the termination of this License. + + +***************** +13) Miscellaneous +***************** + +If any provision of this License is held to be unenforceable, such provision +shall be reformed only to the extent necessary to make it enforceable. + + +*************************************** +14) Definition of "You" in This License +*************************************** + +"You" throughout this License, whether in upper or lower case, means an +individual or a legal entity exercising rights under, and complying with all +of the terms of, this License. For legal entities, "You" includes any entity +that controls, is controlled by, or is under common control with you. For +purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + + +**************** +15) Right to Use +**************** + +You may use the Original Work in all ways not otherwise restricted or +conditioned by this License or by law, and Licensor promises not to interfere +with or be responsible for such uses by You. + + +******************************** +16) Modification of This License +******************************** + +This License is Copyright © 2005 Lawrence Rosen. Permission is granted to +copy, distribute, or communicate this License without modification. Nothing in +this License permits You to modify this License as applied to the Original +Work or to Derivative Works. However, You may modify the text of this License +and copy, distribute or communicate your modified version (the "Modified +License") and apply it to other original works of authorship subject to the +following conditions: (i) You may not indicate in any way that your Modified +License is the "Open Software License" or "OSL" and you may not use those +names in the name of your Modified License; (ii) You must replace the notice +specified in the first paragraph above with the notice "Licensed under <insert +your license name here>" or with a notice of your own that is not confusingly +similar to the notice in this License; and (iii) You may not claim that your +original works are open source software unless your Modified License has been +approved by Open Source Initiative (OSI) and You comply with its license +review and certification process.
\ No newline at end of file diff --git a/user_guide_src/source/tutorial/create_news_items.rst b/user_guide_src/source/tutorial/create_news_items.rst index 003b94bd8..794b67eed 100644 --- a/user_guide_src/source/tutorial/create_news_items.rst +++ b/user_guide_src/source/tutorial/create_news_items.rst @@ -2,7 +2,7 @@ Create news items ################# -You now know how you can read data from a database using CodeIgnite, but +You now know how you can read data from a database using CodeIgniter, but you haven't written any information to the database yet. In this section you'll expand your news controller and model created earlier to include this functionality. diff --git a/user_guide_src/source/tutorial/static_pages.rst b/user_guide_src/source/tutorial/static_pages.rst index 0bbf51b1b..82de2a8cb 100644 --- a/user_guide_src/source/tutorial/static_pages.rst +++ b/user_guide_src/source/tutorial/static_pages.rst @@ -28,7 +28,7 @@ code. <?php class Pages extends CI_Controller { - public function view($page == 'home') + public function view($page = 'home') { } @@ -62,7 +62,7 @@ following code. </head> <body> - <h1>CodeIgniter 2 Tutorial<h1> + <h1>CodeIgniter 2 Tutorial</h1> The header contains the basic HTML code that you'll want to display before loading the main view, together with a heading. It will also |