Permalink
Browse files

Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into …

…develop-fixes-33

Conflicts:
	system/core/Input.php
  • Loading branch information...
2 parents 7fc6f74 + 963386b commit 206a4a349fc029983e0a51cfc5f9b692db4bdaa3 @it-can committed Mar 2, 2012
Showing with 1,854 additions and 2,134 deletions.
  1. +2 −0 application/config/database.php
  2. +3 −3 application/config/mimes.php
  3. +2 −0 index.php
  4. +2 −2 readme.rst
  5. +1 −1 system/core/CodeIgniter.php
  6. +17 −19 system/core/Common.php
  7. +1 −1 system/core/Config.php
  8. +35 −50 system/core/Input.php
  9. +1 −1 system/core/Lang.php
  10. +5 −7 system/core/Loader.php
  11. +2 −4 system/core/Output.php
  12. +106 −173 system/core/Security.php
  13. +1 −0 system/database/DB.php
  14. +4 −4 system/database/DB_active_rec.php
  15. +46 −51 system/database/DB_driver.php
  16. +4 −23 system/database/drivers/cubrid/cubrid_driver.php
  17. +15 −20 system/database/drivers/mssql/mssql_driver.php
  18. +126 −210 system/database/drivers/mysql/mysql_driver.php
  19. +43 −88 system/database/drivers/mysql/mysql_forge.php
  20. +22 −35 system/database/drivers/mysql/mysql_result.php
  21. +30 −45 system/database/drivers/mysql/mysql_utility.php
  22. +129 −204 system/database/drivers/mysqli/mysqli_driver.php
  23. +42 −95 system/database/drivers/mysqli/mysqli_forge.php
  24. +22 −35 system/database/drivers/mysqli/mysqli_result.php
  25. +14 −20 system/database/drivers/mysqli/mysqli_utility.php
  26. +36 −32 system/database/drivers/oci8/oci8_driver.php
  27. +1 −17 system/database/drivers/odbc/odbc_driver.php
  28. +35 −23 system/database/drivers/odbc/odbc_result.php
  29. +215 −110 system/database/drivers/pdo/pdo_driver.php
  30. +8 −4 system/database/drivers/pdo/pdo_forge.php
  31. +65 −2 system/database/drivers/pdo/pdo_result.php
  32. +1 −17 system/database/drivers/postgre/postgre_driver.php
  33. +1 −17 system/database/drivers/sqlite/sqlite_driver.php
  34. +40 −28 system/database/drivers/sqlsrv/sqlsrv_driver.php
  35. +41 −44 system/helpers/download_helper.php
  36. +7 −7 system/helpers/file_helper.php
  37. +96 −56 system/helpers/inflector_helper.php
  38. +6 −16 system/helpers/text_helper.php
  39. +1 −0 system/libraries/Cache/drivers/Cache_apc.php
  40. +1 −1 system/libraries/Cache/drivers/Cache_file.php
  41. +0 −7 system/libraries/Cart.php
  42. +129 −202 system/libraries/Email.php
  43. +37 −75 system/libraries/Encrypt.php
  44. +14 −28 system/libraries/Form_validation.php
  45. +188 −249 system/libraries/Image_lib.php
  46. +1 −1 system/libraries/Pagination.php
  47. +5 −7 system/libraries/Profiler.php
  48. +77 −56 system/libraries/Session.php
  49. +1 −1 system/libraries/Typography.php
  50. +88 −33 system/libraries/Upload.php
  51. +51 −5 user_guide_src/source/changelog.rst
  52. +4 −0 user_guide_src/source/database/configuration.rst
  53. +6 −0 user_guide_src/source/database/connecting.rst
  54. +16 −0 user_guide_src/source/general/styleguide.rst
  55. +7 −4 user_guide_src/source/general/urls.rst
  56. +1 −1 user_guide_src/source/tutorial/static_pages.rst
@@ -37,6 +37,7 @@
| EXPLANATION OF VARIABLES
| -------------------------------------------------------------------
|
+| ['dsn'] The full DSN string describe a connection to the database.
| ['hostname'] The hostname of your database server.
| ['username'] The username used to connect to the database
| ['password'] The password used to connect to the database
@@ -74,6 +75,7 @@
$active_group = 'default';
$active_record = TRUE;
+$db['default']['dsn'] = '';
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = '';
$db['default']['password'] = '';
@@ -120,9 +120,9 @@
'mov' => 'video/quicktime',
'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'),
'movie' => 'video/x-sgi-movie',
- 'doc' => 'application/msword',
- 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
- 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'doc' => array('application/msword', 'application/vnd.ms-office'),
+ 'docx' => array('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/zip'),
+ 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'),
'word' => array('application/msword', 'application/octet-stream'),
'xl' => 'application/excel',
'eml' => 'message/rfc822',
View
@@ -218,6 +218,7 @@
{
if ( ! is_dir(BASEPATH.$application_folder.'/'))
{
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, '503');
exit('Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF);
}
@@ -233,6 +234,7 @@
{
if ( ! is_dir(APPPATH.'views/'))
{
+ header('HTTP/1.1 503 Service Unavailable.', TRUE, '503');
exit('Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF);
}
View
@@ -23,7 +23,7 @@ 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>`_.
+guide change log <https://github.com/EllisLab/CodeIgniter/blob/develop/user_guide_src/source/changelog.rst>`_.
*******************
Server Requirements
@@ -193,4 +193,4 @@ Acknowledgement
***************
The EllisLab team and The Reactor Engineers would like to thank all the
-contributors to the CodeIgniter project and you, the CodeIgniter user.
+contributors to the CodeIgniter project and you, the CodeIgniter user.
@@ -267,7 +267,7 @@ function &get_instance()
$method = $RTR->fetch_method();
if ( ! class_exists($class)
- OR strpos($method, '_', 1) === 0
+ OR strpos($method, '_') === 0
OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller')))
)
{
View
@@ -56,7 +56,7 @@
function is_php($version = '5.0.0')
{
static $_is_php;
- $version = (string)$version;
+ $version = (string) $version;
if ( ! isset($_is_php[$version]))
{
@@ -84,7 +84,7 @@ function is_php($version = '5.0.0')
function is_really_writable($file)
{
// If we're on a Unix server with safe_mode off we call is_writable
- if (DIRECTORY_SEPARATOR === '/' AND @ini_get('safe_mode') == FALSE)
+ if (DIRECTORY_SEPARATOR === '/' && (bool) @ini_get('safe_mode') === FALSE)
{
return is_writable($file);
}
@@ -120,7 +120,7 @@ function is_really_writable($file)
/**
* Class registry
*
-* This function acts as a singleton. If the requested class does not
+* This function acts as a singleton. If the requested class does not
* exist it is instantiated and set to a static variable. If it has
* previously been instantiated the variable is returned.
*
@@ -177,6 +177,7 @@ function &load_class($class, $directory = 'libraries', $prefix = 'CI_')
{
// Note: We use exit() rather then show_error() in order to avoid a
// self-referencing loop with the Excptions class
+ set_status_header(503);
exit('Unable to locate the specified class: '.$class.'.php');
}
@@ -191,15 +192,15 @@ function &load_class($class, $directory = 'libraries', $prefix = 'CI_')
// --------------------------------------------------------------------
/**
-* Keeps track of which libraries have been loaded. This function is
+* Keeps track of which libraries have been loaded. This function is
* called by the load_class() function above
*
* @access public
* @return array
*/
if ( ! function_exists('is_loaded'))
{
- function is_loaded($class = '')
+ function &is_loaded($class = '')
{
static $_is_loaded = array();
@@ -243,6 +244,7 @@ function &get_config($replace = array())
// Fetch the config file
if ( ! file_exists($file_path))
{
+ set_status_header(503);
exit('The configuration file does not exist.');
}
@@ -251,6 +253,7 @@ function &get_config($replace = array())
// Does the $config array exist in the file?
if ( ! isset($config) OR ! is_array($config))
{
+ set_status_header(503);
exit('Your config file does not appear to be formatted correctly.');
}
@@ -434,7 +437,7 @@ function set_status_header($code = 200, $text = '')
show_error('Status codes must be numeric', 500);
}
- if (isset($stati[$code]) AND $text == '')
+ if (isset($stati[$code]) && $text == '')
{
$text = $stati[$code];
}
@@ -444,19 +447,19 @@ function set_status_header($code = 200, $text = '')
show_error('No status text available. Please check your status code number or supply your own message text.', 500);
}
- $server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;
+ $server_protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;
if (strpos(php_sapi_name(), 'cgi') === 0)
{
- header("Status: {$code} {$text}", TRUE);
+ header('Status: '.$code.' '.$text, TRUE);
}
- elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0')
+ elseif ($server_protocol === 'HTTP/1.0')
{
- header($server_protocol." {$code} {$text}", TRUE, $code);
+ header('HTTP/1.0 '.$code.' '.$text, TRUE, $code);
}
else
{
- header("HTTP/1.1 {$code} {$text}", TRUE, $code);
+ header('HTTP/1.1 '.$code.' '.$text, TRUE, $code);
}
}
}
@@ -561,14 +564,9 @@ function remove_invisible_characters($str, $url_encoded = TRUE)
{
function html_escape($var)
{
- if (is_array($var))
- {
- return array_map('html_escape', $var);
- }
- else
- {
- return htmlspecialchars($var, ENT_QUOTES, config_item('charset'));
- }
+ return is_array($var)
+ ? array_map('html_escape', $var)
+ : htmlspecialchars($var, ENT_QUOTES, config_item('charset'));
}
}
View
@@ -80,7 +80,7 @@ public function __construct()
{
if (isset($_SERVER['HTTP_HOST']))
{
- $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
+ $base_url = ! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
$base_url .= '://'. $_SERVER['HTTP_HOST']
. str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
}
Oops, something went wrong.

0 comments on commit 206a4a3

Please sign in to comment.